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

Restore usage of flake8 and add to CI #316

Merged
merged 11 commits into from
Feb 7, 2025
Merged

Restore usage of flake8 and add to CI #316

merged 11 commits into from
Feb 7, 2025

Conversation

danyeaw
Copy link
Contributor

@danyeaw danyeaw commented Jan 31, 2025

In #315, I accidently removed the flake8 configuration that was in the setup.cfg. This PR restores it and makes some additional improvements:

  • Fixes issue detected by flake8
  • Add a pre-commit hook to make it easier to run on each commit
  • Add additional pre-commit hooks to fix trailing whitespace and end of files
  • Add a step to CI to lint the changes

It would also be great to eventually move to using Ruff like jupyter/notebook, but that would be a much larger cleanup effort.

@RRosio
Copy link
Collaborator

RRosio commented Feb 3, 2025

Thank you @danyeaw!

I was thinking that it might be helpful to have the pre-commit information in the CONTRIBUTING.md file? It would be a nice reminder. Maybe something like:


To apply code formatting before committing changes, install pre-commit and the pre-commit git hooks. The hooks are defined in .pre-commit-config.yaml.

pip install pre-commit
pre-commit install
pre-commit run

I can merge this in and follow up on the documentation, or if you'd like to included here as well? Please let me know your thoughts!

@danyeaw
Copy link
Contributor Author

danyeaw commented Feb 4, 2025

Hi @RRosio, thanks so much for the feedback! Clear contributor instructions are really important and this is a great idea to improve this PR. I updated the CONTRIBUTING.rst file.

I was also getting a CI failure because v1 of check-release was using a really old version of actions/cache, so I bumped it to v2 as well.

@RRosio
Copy link
Collaborator

RRosio commented Feb 7, 2025

Thank you @danyeaw!

@RRosio RRosio merged commit b36454a into jupyter:main Feb 7, 2025
32 of 33 checks passed
@danyeaw danyeaw deleted the flake8 branch February 7, 2025 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants