Skip to content

skip_if #715

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

Merged
merged 2 commits into from
Apr 24, 2020
Merged

skip_if #715

merged 2 commits into from
Apr 24, 2020

Conversation

kddnewton
Copy link

@kddnewton kddnewton commented Apr 15, 2020

Closes #714. Provide a similar option to required_executable, except that when the executable isn't present in the path then it automatically exits instead of failing.

Provide a similar option to `required_executable`, except that when the executable isn't present in the path then it automatically exits instead of failing.
@sds
Copy link
Owner

sds commented Apr 17, 2020

Hey @kddeisz, thanks for opening the PR.

Understand the the use case you're aiming for, but this feel antithetical to the original purpose of the tool, which is to enforce consistency for those that use it.

With that said, one can see the potential value of this if organizations/teams opt in to it. However, if we're going to introduce this into Overcommit as base feature, it needs to be more flexible than what is provided in this PR. Allowing organizations/teams to decide when a hook may be skipped is an interesting concept and warrants the full flexibility of options.

Would be open to a pull request that adds an option which executes a command which checks if the hook can be skipped. For example:

MyHook:
  skip_if: ['bash', '-c', '! which my-executable']

The semantics should be that the hook is skipped if the command executed returns successfully.

What are your thoughts?

@kddnewton kddnewton changed the title optional_executable skip_if Apr 19, 2020
@kddnewton
Copy link
Author

@sds yeah that makes total sense. I've updated the PR to be a skip_if option instead.

@kddnewton
Copy link
Author

@sds not sure why those tests are failing but I think this PR is good to go

@sds sds merged commit 9a4028e into sds:master Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optional_executable option
2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy