Skip to content

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.

@UserNotFound UserNotFound requested review from eabruzzese and eloisejones and removed request for UserNotFound and krallin July 17, 2025 15:52
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