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 CI infrastructure for pre-commit checks #62

Merged
merged 14 commits into from
Aug 20, 2024
Merged

Conversation

jcfr
Copy link
Collaborator

@jcfr jcfr commented Aug 18, 2024

Introduce a noxfile1 with two sessions:

  1. pre-commit: Runs pre-commit checks on all files except the ones generated by cookiecutter.
  2. pre-commit-cookie: Runs pre-commit checks on a generated folder based on the cookiecutter template.

The approach was adapted from the implementation at https://github.com/scientific-python/cookie/, originally contributed by @henryiii.

For top-level and cookie-level projects:

  • Add lint.yml GitHub Actions workflows to automate the pre-commit checks.
  • Add commit-message.yml GitHub workflows to enforce Slicer format for commit messages.
  • Add Dependabot settings to keep GitHub Actions up-to-date.

Footnotes

  1. https://nox.thea.codes/en/stable/

This commit updates the sources files based on the automatic fixes
applied using the "end-of-file-fixer" pre-commit hook introduced in
the subsequent commit.
This commit updates the sources files based on the automatic fixes
applied using the "mirrors-prettier" pre-commit hook introduced in
the subsequent commit.
Introduce a noxfile with two sessions:
1. pre-commit: Runs pre-commit checks on all files except the ones generated by cookiecutter.
2. pre-commit-cookie: Runs pre-commit checks on a generated folder based on the cookiecutter template.

The approach was adapted from the implementation at https://github.com/scientific-python/cookie/, originally contributed by @henryiii.

Add corresponding GitHub Actions workflows in lint.yml to automate the pre-commit checks.
This commit updates the sources files based on the automatic fixes
applied using the "isort" ruff rule introduced in the subsequent commit.
This commit updates the sources files based on error reported
after enabling the "flake8-unused-arguments" ruff rule introduced in the
subsequent commit.
Since logic will likely be simplified in subsequent commit, annotations
associated with HomeLogic.run have been omitted.
@jcfr
Copy link
Collaborator Author

jcfr commented Aug 20, 2024

This commit updates the markdown files based on error reported
after updating mirrors-prettier pre-commit hook to run for the
"markdown" type in the subsequent commit.
Copy link
Contributor

@sjh26 sjh26 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jcfr jcfr merged commit 4c01fd1 into main Aug 20, 2024
3 checks passed
@jcfr jcfr deleted the add-ci-infrastructure branch August 20, 2024 15:00
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.

2 participants