-
Notifications
You must be signed in to change notification settings - Fork 91
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 pre-commit
and use ruff
#1659
Conversation
a7e9096
to
eaf426f
Compare
To reiterate what I said on matterless:
- repo: local
hooks:
id: format
entry: ./scripts/format.sh && test -z "$(git status --porcelain=v1)" (which I'm not sure would work with @alanzhu0 @NotFish232 would be nice to get a second opinion on this, when you find the time of course ;) |
3101b09
to
9246b40
Compare
8cadb96
to
df7411e
Compare
e415d0c
to
3d30b97
Compare
I think this PR is mostly ready to be reviewed.
Since the diff is very large, I moved it into a separate PR: #1673 |
c487cdd
to
9807bed
Compare
In order to get the tests to pass (specifically flake8) in #1673, I had to make some changes that don't agree with the ruff (or black for that matter!). As such, the changes in that PR aren't 100% reflective of the changes needed here (but it's a pretty small and easy to review diff after that PR is merged). On another note, if you're wondering why there is a formatting CI run that never completes, it's because it's marked as required in the repository settings. |
ee32239
to
7a6dc1e
Compare
7a6dc1e
to
0a66307
Compare
2f1bc97
to
7f643b8
Compare
f7e450b
to
2e5e6c1
Compare
This removes the need for black, autopep8, and isort Also includes the configuration for pre-commit ci, if it is decided that it should be added.
2e5e6c1
to
bab04ac
Compare
This commit autodocuments Ion apps (removing the need for a script), and fixes many of the formatting errors in the current docs. It also updates the docs for the formatting/linting CI, which was updated in tjcsl#1659
This commit autodocuments Ion apps (removing the need for a script), and fixes many of the formatting errors in the current docs. It also updates the docs for the formatting/linting CI, which was updated in tjcsl#1659
This commit autodocuments Ion apps (removing the need for a script), and fixes many of the formatting errors in the current docs. It also updates the docs for the formatting/linting CI, which was updated in tjcsl#1659
A similar change has been merged into Tin, see tjcsl/tin#21
If you are reviewing this PR, I suggest looking at it commit-by-commit instead of looking at the diff all at once.
Proposed changes
pre-commit
for linting/formattingpre-commit ci
so that if the pre-commit fails, fixes will be pushed without having to run scripts.pre-commit install
and it should run pre-commit locally whenever you commitblack
+autopep8
toruff
black
: https://docs.astral.sh/ruff/formatter/#black-compatibilitypyproject.toml
Brief description of rationale
Running scripts is annoying lol
Summary of Changes
.pre-commit-config.yaml
pre-commit ci
if it is decided to be addedpre-commit
to dependenciespre-commit run --all-files
instead of scripts for formatting/lintingNote
PR #1673 should be merged before this to see if all checks pass.
I just tested locally, there are about ~11 files that are changed after merging it. Once it's merged I'll push a commit updating this PR with those 11 files.
Progress
scripts/format.sh
scripts/lint.sh
scripts/build_sources.sh
scripts/static_templates_format.sh