Skip to content

Commit

Permalink
Error message was confusing with silent enabled
Browse files Browse the repository at this point in the history
If the silent option was enabled, no violations were printed.
The error message then referred to non-existing "above violations".
  • Loading branch information
PW999 authored and jorisroovers committed Dec 21, 2020
1 parent 018f42e commit e06dfe0
Show file tree
Hide file tree
Showing 10 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion docs/demos/asciicinema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2412,7 +2412,7 @@
],
[
0.000020,
"gitlint: \u001b[31mYour commit message contains the above violations.\u001b[0m\r\n"
"gitlint: \u001b[31mYour commit message contains violations.\u001b[0m\r\n"
],
[
0.002541,
Expand Down
2 changes: 1 addition & 1 deletion gitlint/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def run_hook(ctx):
continue

click.echo("-----------------------------------------------")
click.echo("gitlint: " + click.style("Your commit message contains the above violations.", fg='red'))
click.echo("gitlint: " + click.style("Your commit message contains violations.", fg='red'))

value = None
while value not in ["y", "n", "e"]:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)]
Aborted!
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)] gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)] gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)] Commit aborted.
Your commit message:
-----------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)] Editing only possible when --msg-filename is specified.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)] Commit aborted.
Your commit message:
-----------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)]
Aborted!
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)]
Aborted!
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
gitlint: checking commit message...
-----------------------------------------------
gitlint: Your commit message contains the above violations.
gitlint: Your commit message contains violations.
Continue with commit anyways (this keeps the current commit message)? [y(es)/n(no)/e(dit)]
4 changes: 2 additions & 2 deletions qa/test_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class HookTests(BaseTestCase):
u'2: B4 Second line is not empty: "Contënt on the second line"\n',
'3: B6 Body message is missing\n',
'-----------------------------------------------\n',
'gitlint: \x1b[31mYour commit message contains the above violations.\x1b[0m\n']
'gitlint: \x1b[31mYour commit message contains violations.\x1b[0m\n']

def setUp(self):
self.responses = []
Expand Down Expand Up @@ -48,7 +48,7 @@ def _violations(self):
def _interact(self, line, stdin):
self.githook_output.append(line)
# Answer 'yes' to question to keep violating commit-msg
if "Your commit message contains the above violations" in line:
if "Your commit message contains violations" in line:
response = self.responses[self.response_index]
stdin.put(f"{response}\n")
self.response_index = (self.response_index + 1) % len(self.responses)
Expand Down

0 comments on commit e06dfe0

Please sign in to comment.