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

DEV: Run pre-commit checks in ci. #1709

Closed
real-yfprojects opened this issue May 10, 2023 · 1 comment · Fixed by #1712
Closed

DEV: Run pre-commit checks in ci. #1709

real-yfprojects opened this issue May 10, 2023 · 1 comment · Fixed by #1712
Labels
type:enhancement Improvement of an existing function

Comments

@real-yfprojects
Copy link
Collaborator

The problem

We already use pre-commit hooks for QA. However when a contributor doesn't install pre-commit, he can introduce unchecked and unformatted changes that will be require further action for contributors using pre-commit down the line. Currently there is no Github Action enforcing the pre-commit hooks for pull requests. There I would like to add a ci check that runs pre-commit.

Possible Solutions

There are multiple options here:

  1. Add pre-commit command to the lint phony in the Makefile
  2. Use the pre-commit.ci bot that can automatically add a commit with the autofixes from the pre-commit hooks and can run pre-commit autoupdate regularly.
  3. Use the pre-commit.ci lite action that can autofix PRs too.

M3nu has already said that he dislikes bot commits: #1394 (comment)
So option 1 is probably the best. However one could also implement a custom action that commits pre-commit fixes under the name of the previous committer. This should be quite straight-forward iirc.

@real-yfprojects real-yfprojects added the type:enhancement Improvement of an existing function label May 10, 2023
@m3nu
Copy link
Contributor

m3nu commented May 10, 2023

Yes, 1) is good. Helping humans to push good code and showing them, if they don't. 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement Improvement of an existing function
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants