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

ci: add pre-commit ci action #699

Merged
merged 1 commit into from
Sep 6, 2024

Conversation

aaraney
Copy link
Member

@aaraney aaraney commented Aug 7, 2024

Add gh ci action to enforce pre-commit rules.

TODO(future):

It is desirable that pre-commit ci failures that are fixable could also be handled by a gh ci bot. For example, if the pre-commit ci job fails it would be great if you could submit comment a comment like ci: fix, and have another action run and apply the fixes. There are several projects that could accomplish this (e.g. pre-commit lite, pre-commit.ci), however they appear to require installing github apps at the org or repo level and I've not looked into these options enough to pursue either option yet. It may be the case that a self-rolled solution is possible that does not require installing a github app.

@aaraney aaraney self-assigned this Aug 7, 2024
@aaraney aaraney added enhancement New feature or request CI Issues related to the continuous integration testing. labels Aug 7, 2024
@aaraney
Copy link
Member Author

aaraney commented Aug 7, 2024

Hey look, it already found a failure:

fix end of files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing python/services/dataservice/dmod/test/it_data_derive_util.py

@aaraney
Copy link
Member Author

aaraney commented Aug 7, 2024

Once this is merged I will open an issue to track adding a ci action to automate fixing pre-commit ci failures.

Copy link
Contributor

@christophertubbs christophertubbs left a comment

Choose a reason for hiding this comment

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

I figure this is safe due to:

Once this is merged I will open an issue to track adding a ci action to automate fixing pre-commit ci failures.

Good work on adding this, though we might want to expand on this and go with the version matrix and not just 3.10. I dunno. Might not make a big difference.

@christophertubbs christophertubbs merged commit 17b1988 into NOAA-OWP:master Sep 6, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Issues related to the continuous integration testing. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants