-
Notifications
You must be signed in to change notification settings - Fork 87
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
Lint and format code in CI and pre-commit #3085
Conversation
75917ff
to
73d8cfa
Compare
5a60de6
to
6d48b26
Compare
6d48b26
to
a3c81b9
Compare
1018369
to
6987454
Compare
6987454
to
8984d6f
Compare
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.
Thank you! I think this is much needed :) Ruff seems indeed quite efficient.
Some general comments :
- flake8 config in setup.cfg should be removed?
- I think keeping single quotes would allow a lesser impact on git history
- I would go with the pyproject approach for the config
- on a second iteration, we can add this config on all udata plugins I think 🚀
.circleci/config.yml
Outdated
ruff check --fix --select I . | ||
ruff format . |
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'm not sure I see the results of each command separately.
4ebcc7f
to
9056dec
Compare
# Conflicts: # udata/forms/fields.py
e873a90
to
3868616
Compare
5947da1
to
902caa8
Compare
1907c94
to
81ad779
Compare
Remark 1:
Since this PR is heavy, I suggest checking the changes/diff before the commit 6d1b9aa ("style: lint and format code and sort imports"), this commit being the one dedicated to lint and format the code and making the whole PR barely readable :)
Remark 2:
I noticed the team might prefer single quotes (') over double quotes ("). Ruff/Flake8 default rule is to use double quotes, but we can configure a special rule for to use single quotes if the team prefers.
In that case, we can either use a
ruff.toml
to specify this special formatting rule:...or a
pyproject.toml
config file if we want to use a general Python package config file (so the config file can be used for many other config, and/or for Python packaging):Let me know if you want to add those special styles and/or any other, I can modify the code format accordingly in this same PR.