-
Notifications
You must be signed in to change notification settings - Fork 107
adding pre-commit tool into the workflow #608
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
adding pre-commit tool into the workflow #608
Conversation
|
Hi @akkik04, This is great! Thanks, I've been meaning to get around to doing this for a while now. I'm in and out over the next week so I'll get it approved when I'm back. |
Sounds good, thanks! |
joe-clickhouse
left a comment
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.
Look good! Just want to pin the pylint and astroid versions to match what's run in CI.
|
Failing because pre-commit 4.5.1 specifies python_requires >= 3.10 but we still test against 3.9. Looks like pre-commit v4.3.0 allows python 3.9 so maybe pin pre-commit to v4.3.0. Separately, I'll need to do some work to drop clickhouse-connect's support for 3.9. |
|
addressed. |
joe-clickhouse
left a comment
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.
LGTM, thanks!
Closes #607
Summary
Adds a minimal
pre-commitconfiguration sopylintruns automatically on changed Python files when committing..pre-commit-config.yamlwith two local hooks:pylint (clickhouse_connect)– runspylintonly on changed Python files underclickhouse_connect/pylint (tests)– runspylintonly on changed Python files undertests/pylintrcand do not add any extra formatting/whitespace checks beyond what pylint already enforces.This keeps the current linting behavior but automates it at commit time and limits the scope to modified files instead of re-linting the entire repo.
(Usage example for contributors):
Checklist
Delete items not relevant to your PR: