Skip to content
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 config, formatting with black, linting with ruff #2503

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

aganders3
Copy link
Contributor

This closes #2291 and fixes the broken lint check in CI (#2291 (comment)) by replacing it with pre-commit. This will be a lot to review but hopefully it helps give a sense of the scale of changes. Timing-wise I'm not sure if there are any existing PRs you'd rather merge first (I have two open that would need to be rebased, haha).

Configuration is almost entirely in pyproject.toml, with a bit in .pre-commit-config.yaml. The main exclusion is vispy/gloo/gl, which I believe is all/mostly generated code. I tried to comment the configs to explain how values, but of course I'm open to changes on that as well. I played with line-length a bit to pick a sane-ish value and settled on 100 for black, with ruff errors at 110. Pulling it down to 88 (black's default) or 79 created over 1000 more errors I think. So, a lot more but maybe a drop in the bucket compared to the changes already here.

Finally, this adds a .git-blame-ignore-revs file so the one massive commit would be skipped by default in "blame" view on GitHub.

@aganders3
Copy link
Contributor Author

I think the CI failure is the same as this one: #2502 (comment)

@djhoese
Copy link
Member

djhoese commented Jun 22, 2023

I just merged your other PR. Feel free to rebase/merge with main and let's see how CI behaves.

@aganders3 aganders3 marked this pull request as ready for review June 28, 2023 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add pre-commit config to enable auto-formatter and linting on commit
2 participants