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

Check code style using pre-commit and flake8 #454

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

niheconomoum
Copy link

@niheconomoum niheconomoum commented Jan 25, 2024

I've added a small set of pre-commit hooks, including the flake8 linter, to the project. Developers can use these hooks by running pre-commit install. They can bypass the hooks if necessary with git commit -n; see also githooks(5).

I also added a continuous integration (CI) workflow using GitHub Actions. This workflow gets invoked when pushing changes to a branch on GitHub, when filing a pull request, or manually running the workflow (requires write access to the repository on GitHub). Right now, the CI workflow only runs the linter via pre-commit, but I plan to add test, build, and deployment jobs that replicate the old Travis CI workflow. Note that developers can run GitHub Actions locally using act, albeit with some limitations.

Except in one case, I have not actually made any changes to SATOSA's code style. I've also avoided making changes to how SATOSA gets built and packaged. Unfortunately, that means the CI workflow currently fails due to a number of flake8 errors. I'd like to coordinate future changes to address this in a future PR with the core development team and with other contributors (essentially, everyone with an open pull request).

All Submissions:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you added an explanation of what problem you are trying to solve with this PR?
  • Have you added information on what your changes do and why you chose this as your solution?
  • Have you written new tests for your changes?
  • Does your submission pass tests?
  • This project follows PEP8 style guide. Have you run your code against the 'flake8' linter?

This re-uses the pre-commit configuration.
By default, this action uses requirements.txt or pyproject.toml as
hash keys, which do not currently exist, resulting in an error.
The check-yaml pre-commit hook cannot load YAML documents with
SATOSA-specific tags.
@niheconomoum
Copy link
Author

Note that the last three items on the checklist do not apply as this makes no changes to the SATOSA code base itself.

@c00kiemon5ter
Copy link
Member

I think I will move forward with this.

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.

None yet

2 participants