-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add a basic pre-commit lint and autoformat #448
base: master
Are you sure you want to change the base?
Conversation
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.
Consideration should be given to using the following hooks to enable it in the future:
id: blacken-docs (https://github.com/asottile/blacken-docs)
id: insert-license (https://github.com/Lucas-C/pre-commit-hooks)
id: conventional-pre-commit (https://github.com/compilerla/conventional-pre-commit)
Also re-enable mypy is very important for the future
- id: check-yaml | ||
files: .*\.(yaml|yml)$ |
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.
- id: check-yaml | |
files: .*\.(yaml|yml)$ | |
- id: check-yaml | |
files: .*\.(yaml|yml)$ | |
- id: check-added-large-files | |
- id: check-toml |
.pre-commit-config.yaml
Outdated
- repo: https://github.com/psf/black | ||
rev: 23.3.0 | ||
hooks: | ||
- id: black |
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.
Add the name to make it more readable and beautiful when running
- id: black | |
- id: black | |
name: Black (Python formatter) |
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: "v0.0.275" | ||
hooks: | ||
- id: ruff |
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.
Add the name to make it more readable and beautiful when running
- id: ruff | |
- id: ruff | |
name: Ruff (Python linter) |
Another thing that would be really cool would be an edgedb hook to (but not limited to) verifying or formatting the .esdl and .edgeql files |
@fantix feel free commit any of the suggestions. |
Sorry, I didn't mean to close this PR. |
@fantix do let me know if you would like me to target the main branch instead of this drop-py37 branch |
Yes, please! Let's retarget and rebase to the master branch, and get this merged 🙏 |
0972123
to
6d46f3b
Compare
@fantix should be ready for review again now |
e02a529
to
dbb3b3e
Compare
Didn't realise there were merge conflicts, should now be resolved and ready for review @fantix |
(bump) @fantix |
2ea2509
to
543ae15
Compare
@fantix have just rebased now |
Thanks for the updates! I talked to the team and decided we don't want a pre-commit hook yet. However, I think the formatted code could stay (with a few nitpicking, for which I'll add comments on this PR) and we can probably have a test that runs the linter and formatter for checking. |
Yep, we do this too rather that as a pre-commit hook itself. I can recommend using the pre-commit.ci github action/app as this automates the process of checking PRs |
Following up on: #438
Summary of changes
NOTE
Target branch
This is targetting thedrop-py37
branch. As it was assumed this PR would be merged after #435 .Running the lint
The assumption is that pre-commit.ci GitHub integration is going to be setup for this project and therefore a dedicate lint GHA has NOT been setup, although it may look like: