-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Configure pre-commit, update the justfile #890
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #890 +/- ##
==========================================
- Coverage 85.62% 85.55% -0.07%
==========================================
Files 78 78
Lines 14397 14396 -1
Branches 14397 14396 -1
==========================================
- Hits 12327 12317 -10
- Misses 1436 1445 +9
Partials 634 634
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ran just check
on this branch and got a couple of errors:
(env) alec:~/r/hugr$ just check
poetry run pre-commit run --all-files
[INFO] Initializing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Initializing environment for https://github.com/pre-commit/mirrors-mypy:pydantic.
[INFO] Installing environment for https://github.com/astral-sh/ruff-pre-commit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Installing environment for https://github.com/pre-commit/mirrors-mypy.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
check for added large files..............................................Passed
check for case conflicts.................................................Passed
check that executables have shebangs.....................................Failed
- hook id: check-executables-have-shebangs
- exit code: 1
specification/schema/serialization.md: marked executable but has no (or invalid) shebang!
If it isn't supposed to be executable, try: `chmod -x specification/schema/serialization.md`
If on Windows, you may also need to: `git add --chmod=-x specification/schema/serialization.md`
If it is supposed to be executable, double-check its shebang.
check for merge conflicts................................................Passed
check toml...............................................................Passed
check vcs permalinks.....................................................Passed
check yaml...............................................................Passed
detect private key.......................................................Passed
fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook
Fixing specification/schema/hugr_schema_v1.json
Fixing specification/schema/hugr_schema_v0.json
trim trailing whitespace.................................................Passed
fix utf-8 byte order marker..............................................Passed
mixed line ending........................................................Passed
check python ast.........................................................Passed
check docstring is first.................................................Passed
debug statements (python)................................................Passed
ruff.....................................................................Passed
ruff-format..............................................................Passed
mypy.....................................................................Passed
cargo format.............................................................Passed
cargo check..............................................................Passed
cargo test...............................................................Passed
cargo clippy.............................................................Passed
error: Recipe `check` failed on line 13 with exit code 1
Should we fix these before merging?
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Happy to keep or disable those checks.
Let's leave them for now, we can always disable them if they become annoying |
Setups
pre-commit
instead of the ad-hoc.github/pre-commit
file, and cleans up thejust
recipes.The main benefit of this is to avoid running both codebase tests on each commit, since
pre-commit
filters the required checks based on the modified files.Updates
DEVELOPMENT.md
with the new commands. It should be a bit more straightforward now.drive-by: Fixes for the
trailing-whitespace
andend-of-file-fixer
hooks.