-
Notifications
You must be signed in to change notification settings - Fork 85
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
base: dev
Are you sure you want to change the base?
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, just need to find out what's causing the chaos with sorting imports and spacing with slicing.
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
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.
7a6dc1e
to
0a66307
Compare
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
andruff
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.
A similar change has been merged into tin, see tjcsl/tin#21
Progress
scripts/format.sh
scripts/lint.sh
scripts/build_sources.sh
scripts/static_templates_format.sh