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

Use pre-commit framework #223

Merged
merged 7 commits into from
Feb 11, 2022
Merged

Conversation

conradtchan
Copy link
Collaborator

Type of PR:
modification to existing code

Description:
The current pre-commit hook allows the commit to proceed, even if changes have been made. It also doesn't distinguish between staged and unstaged changes within the same file.

Use pre-commit framework to run the bots script instead of using a manual bash script. When pre-commit is enabled (completely optional), commits are blocked unless they are bot compliant.

Previously, pre-commit was installed by copying scripts/pre-commit into the git hooks directory. Now it is installed using

pre-commit install

See https://pre-commit.com

The workflow pre-commit.yml is added, which runs the bots script on push and PRs.

Testing:

  • Made a change to fortran code that was not bot compliant
  • Attempt commit and verify that the commit is stopped, but files were modified
  • Stage new changes and attempt commit, which was successful

Did you run the bots? yes

@conradtchan
Copy link
Collaborator Author

After discussion with @danieljprice, we've concluded that running a pre-commit action is too aggressive, and may deter new developers. Therefore, bots will not be enforced with PRs, only suggested.

@conradtchan conradtchan marked this pull request as ready for review February 10, 2022 23:27
@conradtchan conradtchan merged commit 3c01dd7 into danieljprice:master Feb 11, 2022
@conradtchan conradtchan deleted the precommit branch February 11, 2022 00:25
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.

1 participant