Skip to content

feat: add prek pre-commit setup and enhance mise integration#152

Merged
Ven0m0 merged 2 commits into
mainfrom
copilot/add-prek-precommit-setup
Mar 9, 2026
Merged

feat: add prek pre-commit setup and enhance mise integration#152
Ven0m0 merged 2 commits into
mainfrom
copilot/add-prek-precommit-setup

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 9, 2026

Wires up prek (already a declared dev dependency) with an actual config and git hook installation path; adds mise tasks to make setup one-command.

.pre-commit-config.yaml (new)

Defines two hook groups:

  • pre-commit/pre-commit-hooks: trailing-whitespace, end-of-file-fixer, check-yaml, check-added-large-files (≤1 MB), check-merge-conflict, mixed-line-ending — all excluding generated dirs (lists/releases/, lists/external/, Filters/, userscripts/dist/)
  • local (system language via mise): ruff check+format, eslint, biome, aglint (scoped to lists/{sources,adblock,hostlist}/), shellcheck, and Python unit tests (triggered only on Scripts/*.py changes)

mise.toml

  • install task now also runs uv sync so prek and other Python dev deps are always present
  • New precommit:install — runs uv run prek install --overwrite to wire the git hook
  • New precommit:run — runs uv run prek run --all-files for manual full sweeps

run_pre_commit.sh

Replaced manual Python test invocation with uv run prek run "${@}", falling back to direct unittest discover if uv is absent. Updated to set -Eeuo pipefail per project shell conventions.

# One-time developer setup
mise run install           # installs all deps incl. prek
mise run precommit:install # installs .git/hooks/pre-commit

# Run manually at any time
mise run precommit:run

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@aviator-app
Copy link
Copy Markdown

aviator-app Bot commented Mar 9, 2026

Current Aviator status

Aviator will automatically update this comment as the status of the PR changes.
Comment /aviator refresh to force Aviator to re-examine your PR (or learn about other /aviator commands).

This PR was merged manually (without Aviator). Merging manually can negatively impact the performance of the queue. Consider using Aviator next time.


See the real-time status of this PR on the Aviator webapp.
Use the Aviator Chrome Extension to see the status of your PR within GitHub.

Co-authored-by: Ven0m0 <82972344+Ven0m0@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Prek precommit setup and config to the repository feat: add prek pre-commit setup and enhance mise integration Mar 9, 2026
@Ven0m0 Ven0m0 marked this pull request as ready for review March 9, 2026 04:46
Copilot AI review requested due to automatic review settings March 9, 2026 04:46
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@Ven0m0 Ven0m0 merged commit ade10e8 into main Mar 9, 2026
9 of 12 checks passed
@Ven0m0 Ven0m0 deleted the copilot/add-prek-precommit-setup branch March 9, 2026 04:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a working prek/pre-commit setup and makes installation/running available via mise tasks, with a simplified run_pre_commit.sh wrapper.

Changes:

  • Introduces .pre-commit-config.yaml with standard pre-commit-hooks plus local hooks (ruff/eslint/biome/aglint/shellcheck/unit tests).
  • Extends mise tasks to run uv sync on install and adds tasks to install/run prek hooks.
  • Replaces the old run_pre_commit.sh test runner with uv run prek run, with a fallback when uv is missing.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
run_pre_commit.sh Replaces ad-hoc test/script execution with prek invocation (and a fallback path).
mise.toml Adds uv sync to install and provides precommit:* tasks to install/run hooks.
.pre-commit-config.yaml Defines the actual pre-commit/prek hooks executed by the repo.

Comment thread .pre-commit-config.yaml
Comment on lines +15 to +18
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-merge-conflict
- id: mixed-line-ending
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR description says the generated dirs are excluded for these hooks, but the config only applies exclude: to trailing-whitespace and end-of-file-fixer. As written, check-added-large-files / check-merge-conflict / mixed-line-ending will still run (and potentially fail/modify) on lists/releases/, lists/external/, Filters/, and userscripts/dist/. Consider adding the same exclude: to the remaining relevant hooks, or add a top-level exclude: so the exclusion is applied consistently to all hooks.

Suggested change
- id: check-added-large-files
args: [--maxkb=1024]
- id: check-merge-conflict
- id: mixed-line-ending
- id: check-added-large-files
exclude: ^(lists/(releases|external)/|Filters/|userscripts/dist/)
args: [--maxkb=1024]
- id: check-merge-conflict
exclude: ^(lists/(releases|external)/|Filters/|userscripts/dist/)
- id: mixed-line-ending
exclude: ^(lists/(releases|external)/|Filters/|userscripts/dist/)

Copilot uses AI. Check for mistakes.
Comment thread run_pre_commit.sh
uv run prek run "${@}"
else
# Fallback: run checks manually if uv/prek is unavailable
python3 -m unittest discover -s Scripts/ -p 'test_*.py'
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wrapper no longer runs python3 Scripts/deduplicate.py (which the prior version executed as “Test actual script”). If running deduplicate.py is still intended as part of the pre-commit workflow, it should be added as a dedicated pre-commit hook (preferred) or included in the fallback path so behavior remains consistent when developers use this script.

Suggested change
python3 -m unittest discover -s Scripts/ -p 'test_*.py'
python3 -m unittest discover -s Scripts/ -p 'test_*.py'
python3 Scripts/deduplicate.py

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants