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

Configure pre-commit-hooks.yaml #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jcomo
Copy link

@jcomo jcomo commented Dec 30, 2022

We use pre-commit to run a series of linters/fixers against our code before we land diffs in the main branch. I've put together a simple integration for pre-commit for supercronic, and was wondering if this would be something that's useful to merge into upstream.

In order to define a linter, a .pre-commit-hooks.yaml file needs to be added to the root of the repo, and - depending on the language - an environment will be automatically set up to run the linter. In this case, the golang environment runs go install ./..., so we can use the supercronic binary as-is.

Other than adding the hooks config file, the main change in this PR is to allow multiple filenames to be passed in combination with the -test flag. This is how pre-commit works: it sends the list of files to the entrypoint as args.

By default, I've configured the pre-commit hook to look changes to files with .crontab, but users can override this in their own repo configs.

Let me know if this is something you'd want to merge in. No worries if not -- happy to close this PR if it's not relevant, and we'll continue to use the fork.

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