-
Notifications
You must be signed in to change notification settings - Fork 96
Add pre-commit #575
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
base: master
Are you sure you want to change the base?
Add pre-commit #575
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| --- | ||
| repos: | ||
| - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| rev: v6.0.0 | ||
| hooks: | ||
| - id: trailing-whitespace | ||
| - id: mixed-line-ending | ||
| args: ['--fix', 'lf'] | ||
| - id: fix-byte-order-marker | ||
stephenfin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - id: check-executables-have-shebangs | ||
stephenfin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - id: check-merge-conflict | ||
| - id: debug-statements | ||
| - id: check-yaml | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.15.4 | ||
| hooks: | ||
| - id: ruff-check | ||
| args: ['--fix', '--unsafe-fixes'] | ||
| - id: ruff-format | ||
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,10 +12,9 @@ commands = | |
|
|
||
| [testenv:ruff] | ||
| deps = | ||
| ruff | ||
| pre-commit | ||
| commands = | ||
| ruff check --fix . | ||
| ruff format . | ||
| pre-commit run -a | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we avoid this? I'm happy to see config for pre-commit shipped, but don't really want to add it as a hard dependency.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The concern with not doing this is that you end with two linter configurations which may subtly differ. This usually means someone who uses More to the point, I don't think there's really a dependency here. It's not needed at runtime. Distro packagers don't need to worry about. Devs don't need to even install it on their system since they can just rely on tox to do so. (I also wouldn't call tox a dependency for similar reasoning)
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So I'm happy to see pre-commit config added if people find that helpful. It does add extra overhead in cases that aren't really precommits (i.e. CI) and I don't personally use it. We already have configuration for ruff, tox, CI, testr as well as a Makefile that all have config for how to run tests/linting/etc. |
||
|
|
||
| [testenv:mypy] | ||
| deps = | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.