Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
pre-commit:
parallel: true
commands:
ruff-lint:
glob: "*.py"
run: ruff check --fix {staged_files}
stage_fixed: true

ruff-format:
glob: "*.py"
run: ruff format {staged_files}
stage_fixed: true
Comment on lines +2 to +12
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Running ruff-lint and ruff-format in parallel can cause race conditions since both commands may try to modify the same files simultaneously. The format command should run after lint completes to ensure consistent results. Consider setting parallel: false or using the piped: true option to run commands sequentially, or move ruff-format to a separate sequential group.

Copilot uses AI. Check for mistakes.

mypy:
glob: "*.py"
run: mypy {staged_files}
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

Running mypy on individual staged files may miss type errors related to imports and cross-module dependencies. The CI workflow runs mypy . to type-check the entire codebase. Consider changing this to run mypy . instead of mypy {staged_files} to maintain consistency with CI and catch all type errors. Alternatively, if you want to keep it file-specific for performance, you may want to add a flag like --follow-imports=silent to avoid false positives.

Suggested change
run: mypy {staged_files}
run: mypy .

Copilot uses AI. Check for mistakes.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pytest
repo-smith

# Developer tooling dependencies
lefthook
ruff
mypy
PyGithub
Expand Down
4 changes: 4 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ fi
source venv/bin/activate

pip install -r requirements.txt -U --no-cache-dir

if ! command -v lefthook &>/dev/null; then
Copy link

Copilot AI Feb 17, 2026

Choose a reason for hiding this comment

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

The logic is inverted. The condition checks if the command does NOT exist (! command -v lefthook), but then attempts to run lefthook install. This will fail because lefthook won't be available. The installation should happen after pip installs the requirements (which includes lefthook), so the condition should check if lefthook DOES exist. Change the condition to if command -v lefthook &>/dev/null; then or remove the negation operator.

Suggested change
if ! command -v lefthook &>/dev/null; then
if command -v lefthook &>/dev/null; then

Copilot uses AI. Check for mistakes.
lefthook install
fi