#1096: Rule: Bypass failed git hook (#1097)

* naive implementation

* better implementation

* remove redundant enabled_by_default

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>

* add README entry

* add tests

Co-authored-by: Pablo Aguiar <scorphus@gmail.com>
This commit is contained in:
Divya Jain
2020-07-17 03:02:29 +05:30
committed by GitHub
parent 365db1ee41
commit 39753a004e
3 changed files with 71 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
from thefuck.utils import replace_argument
from thefuck.specific.git import git_support
hooked_commands = ("am", "commit", "push")
@git_support
def match(command):
return any(
hooked_command in command.script_parts for hooked_command in hooked_commands
)
@git_support
def get_new_command(command):
hooked_command = next(
hooked_command
for hooked_command in hooked_commands
if hooked_command in command.script_parts
)
return replace_argument(
command.script, hooked_command, hooked_command + " --no-verify"
)
priority = 900
requires_output = False