-
Notifications
You must be signed in to change notification settings - Fork 616
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 to enable auto-formatter and linting on commit #2291
Comments
I just noticed that linting with This is due to a change in flake8 where its I am happy to make a PR to fix this small issue (and the linting issues that have crept in as a result), but when searching for an existing issue I found this one. Instead I would be interested in adding a pre-commit config if that's the direction you'd lake to take this anyway. |
I'm good with a pre-commit. I'd also be OK trying to use Not sure how the other @vispy/core maintainers feel, but I kind of just want to enable black on the whole repository. |
numpydoc did this about a year ago and we did it a few months ago for MNE-Python. No regrets. Same goes for |
Again I'm happy to do some of the tedious work if others are willing to provide sanity checks and review. I can open a PR at least to see what this could look like if that's welcome. A quick test locally shows some issues where there is a bit of Python magic going on (undefined symbols, etc.) so my instinct is to exclude some of the files in |
I think excluding codegen is fine. I thought I cleaned up most of the flake8 issues in it, but definitely any of the files that codegen generates (which I think are the ones in vispy/gloo/gl) should be excluded. |
See https://pre-commit.com/
Related #2146
A pre-commit config is a great utility/tool to take advantage of to avoid code style, security, and other types of issues before the code is ever committed. With the additional use of
pre-commit.ci
, we can enable the execution of it on PRs.We could borrow from projects like:
I think a good starting point would be
black
andflake8
and see how bad the complaints are. We may not be able to enablepre-commit.ci
immediately as it has to succeed on the entire repository and VisPy docstrings are just not consistent enough for that.The text was updated successfully, but these errors were encountered: