Skip to content
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

Pre-commit hook local just fails #2017

Closed
madwort opened this issue May 14, 2024 · 1 comment · Fixed by #2020
Closed

Pre-commit hook local just fails #2017

madwort opened this issue May 14, 2024 · 1 comment · Fixed by #2020

Comments

@madwort
Copy link
Contributor

madwort commented May 14, 2024

It appears to be passing the filename of files modified in the proposed commit as recipe names to just - it probably doesn't need to do this.

(.venv) tom@MadBook3 ehrql % just check
=> ruff format --diff --quiet .
=> ruff check --output-format=full .
All checks passed!
=> docker run --rm -i ghcr.io/hadolint/hadolint:v2.12.0-alpine < Dockerfile
(.venv) tom@MadBook3 ehrql % git commit -a
check....................................................................Failed
- hook id: check
- exit code: 1

error: Justfile does not contain recipe `tests/generative/ignored_errors.py`.

trim trailing whitespace.................................................Passed
fix end of files.........................................................Passed
debug statements (python)................................................Passed
check python ast.........................................................Passed
check json...........................................(no files to check)Skipped
check toml...........................................(no files to check)Skipped
check yaml...........................................(no files to check)Skipped
detect private key.......................................................Passed
(.venv) tom@MadBook3 ehrql % just check
=> ruff format --diff --quiet .
=> ruff check --output-format=full .
All checks passed!
=> docker run --rm -i ghcr.io/hadolint/hadolint:v2.12.0-alpine < Dockerfile
(.venv) tom@MadBook3 ehrql % just check tests/generative/ignored_errors.py
error: Justfile does not contain recipe `tests/generative/ignored_errors.py`.
@madwort
Copy link
Contributor Author

madwort commented May 14, 2024

@evansd says

You can disable pre-commit for a single repo using: git config core.hooksPath /dev/null

evansd added a commit that referenced this issue May 15, 2024
This does mean that pre-commit will fail on ill-formatted files which
aren't part of your commit. But if you regularly have such files in your
repo and you also like using pre-commit then you've just made two bad
life choices.

Closes #2017
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 a pull request may close this issue.

1 participant