-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Pre-commit hook #447
Comments
doit does NOT always return It seems you want a non-zero return code if any task is actually executed (not up-to-date). is that it? currently not possible but should not be hard to achieve this somehow... Regarding pre-commit package. I am not familiar with the project implementation. |
Yes, exactly. There would be two possible modes for such a hook. A mode that only checks that everything is up-to-date and doesn't modify any files. And a mode that actually runs the tasks.
You define how to run your hook in a small
That isn't a problem since the hook can be used additionally to running doit manually. |
What use-case is this, exactly? The |
I am unsure what you mean. I use doit to perform certain automated tasks on which files change. These tasks are necessary for a valid repository state. Thus I'd like to add a pre-commit hook, that ensures that commits cannot be created containing partial states on which doit was't run yet. I feel like that would be a common use case. It's the same as running a code formatter before every commit. |
I would like to use doit as a pre-commit hook. I have a couple of 'build' tasks that generate source files. These source files should be present and also up-to-date in each commit. Not only doesn't doit provide its own
.pre-commit-hooks.yaml
file, but i can't define my own hook using doit since doit will always return code0
. I would like to have an option which makes doit fail if one of the tasks run modified a file. Also I would like doit to provide a pre-configured pre-commit hook.The text was updated successfully, but these errors were encountered: