summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-19 13:27:09 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-04-19 13:27:09 +0000
commit643bc3635e75121826fb878f46ca540ce210bace (patch)
treedf410cfc4a0c1c67068d40f4d10c8ca5574a4b1c
parentAdding upstream version 0.15.0. (diff)
downloadgitlint-643bc3635e75121826fb878f46ca540ce210bace.tar.xz
gitlint-643bc3635e75121826fb878f46ca540ce210bace.zip
Adding upstream version 0.15.1.upstream/0.15.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--CHANGELOG.md11
-rw-r--r--docs/contrib_rules.md8
-rw-r--r--docs/demos/asciicinema.json2
-rw-r--r--docs/rules.md6
-rw-r--r--docs/user_defined_rules.md22
-rw-r--r--examples/my_commit_rules.py8
-rw-r--r--gitlint/__init__.py2
-rw-r--r--gitlint/cli.py2
-rw-r--r--gitlint/contrib/rules/signedoff_by.py8
-rw-r--r--gitlint/rules.py2
-rw-r--r--gitlint/tests/contrib/rules/test_signedoff_by.py12
-rw-r--r--gitlint/tests/expected/cli/test_cli/test_contrib_12
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout2
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout6
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout2
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout2
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout2
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout2
-rw-r--r--gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout2
-rw-r--r--gitlint/tests/rules/test_body_rules.py10
-rw-r--r--gitlint/utils.py2
-rw-r--r--qa/expected/test_config/test_config_from_env_12
-rw-r--r--qa/expected/test_contrib/test_contrib_rules_12
-rw-r--r--qa/expected/test_contrib/test_contrib_rules_with_config_12
-rw-r--r--qa/expected/test_user_defined/test_user_defined_rules_examples_12
-rw-r--r--qa/expected/test_user_defined/test_user_defined_rules_examples_22
-rw-r--r--qa/expected/test_user_defined/test_user_defined_rules_examples_with_config_12
-rw-r--r--qa/requirements.txt4
-rw-r--r--qa/test_hooks.py4
-rw-r--r--requirements.txt4
-rw-r--r--setup.py2
-rw-r--r--test-requirements.txt12
32 files changed, 87 insertions, 66 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7eb2e0b..bb72596 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,16 @@
# Changelog #
+## v0.15.1 (2021-04-16) ##
+
+Contributors:
+Special thanks to all contributors for this release, in particular [PW999](https://github.com/PW999), [gsemet](https://github.com/gsemet) and [Lorac](https://github.com/Lorac).
+
+Bugfixes:
+ - Git commit message body with only new lines is not longer considered empty by `body-is-missing` ([#176](https://github.com/jorisroovers/gitlint/issues/176))
+ - Added compatibility with `git commit -s` for `contrib-requires-signed-off-by` rule ([#178](https://github.com/jorisroovers/gitlint/pull/178))
+- Minor tweak to gitlint commit-hook output ([#173](https://github.com/jorisroovers/gitlint/pull/173))
+- All dependencies have been upgraded to the latest available versions (`Click==7.1.2`, `arrow==1.0.3`, `sh==1.14.1`).
+- Minor doc fixes
## v0.15.0 (2020-11-27) ##
Contributors:
diff --git a/docs/contrib_rules.md b/docs/contrib_rules.md
index e376fb8..336e42a 100644
--- a/docs/contrib_rules.md
+++ b/docs/contrib_rules.md
@@ -10,7 +10,7 @@ re-implement these commonly used rules themselves as [user-defined](user_defined
To enable certain contrib rules, you can use the `--contrib` flag.
```sh
$ cat examples/commit-message-1 | gitlint --contrib contrib-title-conventional-commits,CC1
-1: CC1 Body does not contain a 'Signed-Off-By' line
+1: CC1 Body does not contain a 'Signed-off-by' line
1: CL1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test: "WIP: This is the title of a commit message."
# These are the default violations
@@ -41,7 +41,7 @@ You can also configure contrib rules using [any of the other ways to configure g
ID | Name | gitlint version | Description
------|-------------------------------------|------------------ |-------------------------------------------
CT1 | contrib-title-conventional-commits | >= 0.12.0 | Enforces [Conventional Commits](https://www.conventionalcommits.org/) commit message style on the title.
-CC1 | contrib-requires-signed-off-by | >= 0.12.0 | Commit body must contain a `Signed-Off-By` line.
+CC1 | contrib-body-requires-signed-off-by | >= 0.12.0 | Commit body must contain a `Signed-off-by` line.
## CT1: contrib-title-conventional-commits ##
@@ -56,11 +56,11 @@ Name | gitlint version | Default | Description
types | >= 0.12.0 | `fix,feat,chore,docs,style,refactor,perf,test,revert,ci,build` | Comma separated list of allowed commit types.
-## CC1: contrib-requires-signed-off-by ##
+## CC1: contrib-body-requires-signed-off-by ##
ID | Name | gitlint version | Description
------|---------------------------------------|--------------------|-------------------------------------------
-CC1 | contrib-requires-signed-off-by | >= 0.12.0 | Commit body must contain a `Signed-Off-By` line. This means, a line that starts with the `Signed-Off-By` keyword.
+CC1 | contrib-body-requires-signed-off-by | >= 0.12.0 | Commit body must contain a `Signed-off-by` line. This means, a line that starts with the `Signed-off-by` keyword.
## Contributing Contrib rules
diff --git a/docs/demos/asciicinema.json b/docs/demos/asciicinema.json
index b499765..c6e2747 100644
--- a/docs/demos/asciicinema.json
+++ b/docs/demos/asciicinema.json
@@ -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,
diff --git a/docs/rules.md b/docs/rules.md
index 23b8e91..9779c54 100644
--- a/docs/rules.md
+++ b/docs/rules.md
@@ -17,7 +17,7 @@ T4 | title-hard-tab | >= 0.1.0 | Title cannot contain h
T5 | title-must-not-contain-word | >= 0.1.0 | Title cannot contain certain words (default: "WIP")
T6 | title-leading-whitespace | >= 0.4.0 | Title cannot have leading whitespace (space or tab)
T7 | title-match-regex | >= 0.5.0 | Title must match a given regex (default: None)
-T8 | title-max-length | >= 0.14.0 | Title length must be &gt; 5 chars.
+T8 | title-min-length | >= 0.14.0 | Title length must be &gt; 5 chars.
B1 | body-max-line-length | >= 0.1.0 | Lines in the body must be &lt; 80 chars
B2 | body-trailing-whitespace | >= 0.1.0 | Body cannot have trailing whitespace (space or tab)
B3 | body-hard-tab | >= 0.1.0 | Body cannot contain hard tab characters (\t)
@@ -397,9 +397,9 @@ regex | >= 0.14.0 | None | [Pyt
[ignore-body-lines]
regex=^Co-Authored-By
-# Ignore lines that start with 'Co-Authored-By' or with 'Signed-Off-By'
+# Ignore lines that start with 'Co-Authored-By' or with 'Signed-off-by'
[ignore-body-lines]
-regex=(^Co-Authored-By)|(^Signed-Off-By)
+regex=(^Co-Authored-By)|(^Signed-off-by)
# Ignore lines that contain 'foobar'
[ignore-body-lines]
diff --git a/docs/user_defined_rules.md b/docs/user_defined_rules.md
index fd944d1..3b9f5e7 100644
--- a/docs/user_defined_rules.md
+++ b/docs/user_defined_rules.md
@@ -9,8 +9,8 @@ for python files containing gitlint rule classes. You can also specify a single
```sh
cat examples/commit-message-1 | gitlint --extra-path examples/
-# Example output of a user-defined Signed-Off-By rule
-1: UC2 Body does not contain a 'Signed-Off-By Line'
+# Example output of a user-defined Signed-off-by rule
+1: UC2 Body does not contain a 'Signed-off-by Line'
# other violations were removed for brevity
```
@@ -23,9 +23,9 @@ which is part of the examples directory that was passed via `--extra-path`:
from gitlint.rules import CommitRule, RuleViolation
class SignedOffBy(CommitRule):
- """ This rule will enforce that each commit contains a "Signed-Off-By" line.
+ """ This rule will enforce that each commit contains a "Signed-off-by" line.
We keep things simple here and just check whether the commit body contains a
- line that starts with "Signed-Off-By".
+ line that starts with "Signed-off-by".
"""
# A rule MUST have a human friendly name
@@ -39,10 +39,10 @@ class SignedOffBy(CommitRule):
self.log.debug("SignedOffBy: This will be visible when running `gitlint --debug`")
for line in commit.message.body:
- if line.startswith("Signed-Off-By"):
+ if line.startswith("Signed-off-by"):
return
- msg = "Body does not contain a 'Signed-Off-By' line"
+ msg = "Body does not contain a 'Signed-off-by' line"
return [RuleViolation(self.id, msg, line_nr=1)]
```
@@ -95,9 +95,9 @@ Consider the following `CommitRule` that can be found in [examples/my_commit_rul
from gitlint.rules import CommitRule, RuleViolation
class SignedOffBy(CommitRule):
- """ This rule will enforce that each commit contains a "Signed-Off-By" line.
+ """ This rule will enforce that each commit contains a "Signed-off-by" line.
We keep things simple here and just check whether the commit body contains a
- line that starts with "Signed-Off-By".
+ line that starts with "Signed-off-by".
"""
# A rule MUST have a human friendly name
@@ -111,10 +111,10 @@ class SignedOffBy(CommitRule):
self.log.debug("SignedOffBy: This will be visible when running `gitlint --debug`")
for line in commit.message.body:
- if line.startswith("Signed-Off-By"):
+ if line.startswith("Signed-off-by"):
return
- msg = "Body does not contain a 'Signed-Off-By' line"
+ msg = "Body does not contain a 'Signed-off-by' line"
return [RuleViolation(self.id, msg, line_nr=1)]
```
Note the use of the `name` and `id` class attributes and the `validate(...)` method taking a single `commit` parameter.
@@ -368,7 +368,7 @@ class ReleaseConfigurationRule(ConfigurationRule):
# NOT modify your actual commit in git)
commit.message.body = [line for line in commit.message.body if not line.startswith("$")]
- # You can add any extra properties you want to the commit object,
+ # You can add any extra properties you want to the commit object,
# these will be available later on in all rules.
commit.my_property = "This is my property"
```
diff --git a/examples/my_commit_rules.py b/examples/my_commit_rules.py
index 5a66c94..2805501 100644
--- a/examples/my_commit_rules.py
+++ b/examples/my_commit_rules.py
@@ -40,8 +40,8 @@ class BodyMaxLineCount(CommitRule):
class SignedOffBy(CommitRule):
- """ This rule will enforce that each commit contains a "Signed-Off-By" line.
- We keep things simple here and just check whether the commit body contains a line that starts with "Signed-Off-By".
+ """ This rule will enforce that each commit contains a "Signed-off-by" line.
+ We keep things simple here and just check whether the commit body contains a line that starts with "Signed-off-by".
"""
# A rule MUST have a human friendly name
@@ -54,10 +54,10 @@ class SignedOffBy(CommitRule):
self.log.debug("SignedOffBy: This will be visible when running `gitlint --debug`")
for line in commit.message.body:
- if line.startswith("Signed-Off-By"):
+ if line.startswith("Signed-off-by"):
return
- return [RuleViolation(self.id, "Body does not contain a 'Signed-Off-By' line", line_nr=1)]
+ return [RuleViolation(self.id, "Body does not contain a 'Signed-off-by' line", line_nr=1)]
class BranchNamingConventions(CommitRule):
diff --git a/gitlint/__init__.py b/gitlint/__init__.py
index 9da2f8f..903e77c 100644
--- a/gitlint/__init__.py
+++ b/gitlint/__init__.py
@@ -1 +1 @@
-__version__ = "0.15.0"
+__version__ = "0.15.1"
diff --git a/gitlint/cli.py b/gitlint/cli.py
index b162e5b..9b16d47 100644
--- a/gitlint/cli.py
+++ b/gitlint/cli.py
@@ -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"]:
diff --git a/gitlint/contrib/rules/signedoff_by.py b/gitlint/contrib/rules/signedoff_by.py
index c2034e7..139a1b1 100644
--- a/gitlint/contrib/rules/signedoff_by.py
+++ b/gitlint/contrib/rules/signedoff_by.py
@@ -3,8 +3,8 @@ from gitlint.rules import CommitRule, RuleViolation
class SignedOffBy(CommitRule):
- """ This rule will enforce that each commit body contains a "Signed-Off-By" line.
- We keep things simple here and just check whether the commit body contains a line that starts with "Signed-Off-By".
+ """ This rule will enforce that each commit body contains a "Signed-off-by" line.
+ We keep things simple here and just check whether the commit body contains a line that starts with "Signed-off-by".
"""
name = "contrib-body-requires-signed-off-by"
@@ -12,7 +12,7 @@ class SignedOffBy(CommitRule):
def validate(self, commit):
for line in commit.message.body:
- if line.startswith("Signed-Off-By"):
+ if line.lower().startswith("signed-off-by"):
return []
- return [RuleViolation(self.id, "Body does not contain a 'Signed-Off-By' line", line_nr=1)]
+ return [RuleViolation(self.id, "Body does not contain a 'Signed-off-by' line", line_nr=1)]
diff --git a/gitlint/rules.py b/gitlint/rules.py
index 3dc85b7..db21e56 100644
--- a/gitlint/rules.py
+++ b/gitlint/rules.py
@@ -290,7 +290,7 @@ class BodyMissing(CommitRule):
# ignore merges when option tells us to, which may have no body
if self.options['ignore-merge-commits'].value and commit.is_merge_commit:
return
- if len(commit.message.body) < 2:
+ if len(commit.message.body) < 2 or not ''.join(commit.message.body).strip():
return [RuleViolation(self.id, "Body message is missing", None, 3)]
diff --git a/gitlint/tests/contrib/rules/test_signedoff_by.py b/gitlint/tests/contrib/rules/test_signedoff_by.py
index c92f1a6..0369cdc 100644
--- a/gitlint/tests/contrib/rules/test_signedoff_by.py
+++ b/gitlint/tests/contrib/rules/test_signedoff_by.py
@@ -17,16 +17,16 @@ class ContribSignedOffByTests(BaseTestCase):
self.assertIn(SignedOffBy(), config.rules)
def test_signedoff_by(self):
- # No violations when 'Signed-Off-By' line is present
+ # No violations when 'Signed-off-by' line is present
rule = SignedOffBy()
- violations = rule.validate(self.gitcommit("Föobar\n\nMy Body\nSigned-Off-By: John Smith"))
+ violations = rule.validate(self.gitcommit("Föobar\n\nMy Body\nSigned-off-by: John Smith"))
self.assertListEqual([], violations)
- # Assert violation when no 'Signed-Off-By' line is present
+ # Assert violation when no 'Signed-off-by' line is present
violations = rule.validate(self.gitcommit("Föobar\n\nMy Body"))
- expected_violation = RuleViolation("CC1", "Body does not contain a 'Signed-Off-By' line", line_nr=1)
+ expected_violation = RuleViolation("CC1", "Body does not contain a 'Signed-off-by' line", line_nr=1)
self.assertListEqual(violations, [expected_violation])
- # Assert violation when no 'Signed-Off-By' in title but not in body
- violations = rule.validate(self.gitcommit("Signed-Off-By\n\nFöobar"))
+ # Assert violation when no 'Signed-off-by' in title but not in body
+ violations = rule.validate(self.gitcommit("Signed-off-by\n\nFöobar"))
self.assertListEqual(violations, [expected_violation])
diff --git a/gitlint/tests/expected/cli/test_cli/test_contrib_1 b/gitlint/tests/expected/cli/test_cli/test_contrib_1
index cdfb821..ed21eca 100644
--- a/gitlint/tests/expected/cli/test_cli/test_contrib_1
+++ b/gitlint/tests/expected/cli/test_cli/test_contrib_1
@@ -1,3 +1,3 @@
-1: CC1 Body does not contain a 'Signed-Off-By' line
+1: CC1 Body does not contain a 'Signed-off-by' line
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert, ci, build: "Test tïtle"
1: CT1 Title does not follow ConventionalCommits.org format 'type(optional-scope): description': "Test tïtle"
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout
index 5d3f1fc..bee014b 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_config_1_stdout
@@ -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!
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout
index fa6b3bc..b57a35a 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_edit_1_stdout
@@ -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:
-----------------------------------------------
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout
index a95bfea..0b8e90e 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_local_commit_1_stdout
@@ -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.
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout
index 9cc53c1..98a83b1 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_1_stdout
@@ -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:
-----------------------------------------------
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout
index 5d3f1fc..bee014b 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_no_tty_1_stdout
@@ -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!
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout
index 5d3f1fc..bee014b 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_stdin_violations_1_stdout
@@ -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!
diff --git a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout
index bb753b0..0414712 100644
--- a/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout
+++ b/gitlint/tests/expected/cli/test_cli_hooks/test_hook_yes_1_stdout
@@ -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)] \ No newline at end of file
diff --git a/gitlint/tests/rules/test_body_rules.py b/gitlint/tests/rules/test_body_rules.py
index 96ae998..a268585 100644
--- a/gitlint/tests/rules/test_body_rules.py
+++ b/gitlint/tests/rules/test_body_rules.py
@@ -126,6 +126,16 @@ class BodyRuleTests(BaseTestCase):
violations = rule.validate(commit)
self.assertListEqual(violations, [expected_violation])
+ def test_body_missing_multiple_empty_new_lines(self):
+ rule = rules.BodyMissing()
+
+ # body is too short
+ expected_violation = rules.RuleViolation("B6", "Body message is missing", None, 3)
+
+ commit = self.gitcommit("Tïtle\n\n\n\n")
+ violations = rule.validate(commit)
+ self.assertListEqual(violations, [expected_violation])
+
def test_body_missing_merge_commit(self):
rule = rules.BodyMissing()
diff --git a/gitlint/utils.py b/gitlint/utils.py
index 6976aac..c91184b 100644
--- a/gitlint/utils.py
+++ b/gitlint/utils.py
@@ -71,7 +71,7 @@ def getpreferredencoding():
# This scenario is fairly common on Windows where git sets LC_CTYPE=C when invoking the commit-msg hook, which
# is not a valid encoding in Python on Windows.
try:
- codecs.lookup(default_encoding)
+ codecs.lookup(default_encoding) # pylint: disable=no-member
except LookupError:
default_encoding = fallback_encoding
diff --git a/qa/expected/test_config/test_config_from_env_1 b/qa/expected/test_config/test_config_from_env_1
index dd761da..f3947bb 100644
--- a/qa/expected/test_config/test_config_from_env_1
+++ b/qa/expected/test_config/test_config_from_env_1
@@ -85,7 +85,7 @@ is-revert-commit: False
Branches: ['master']
Changed Files: {changed_files}
-----------------------
-1: CC1 Body does not contain a 'Signed-Off-By' line
+1: CC1 Body does not contain a 'Signed-off-by' line
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert, ci, build
1: T3 Title has trailing punctuation (.)
1: T5 Title contains the word 'WIP' (case-insensitive)
diff --git a/qa/expected/test_contrib/test_contrib_rules_1 b/qa/expected/test_contrib/test_contrib_rules_1
index 0d333bc..6876c80 100644
--- a/qa/expected/test_contrib/test_contrib_rules_1
+++ b/qa/expected/test_contrib/test_contrib_rules_1
@@ -1,4 +1,4 @@
-1: CC1 Body does not contain a 'Signed-Off-By' line
+1: CC1 Body does not contain a 'Signed-off-by' line
1: CT1 Title does not start with one of fix, feat, chore, docs, style, refactor, perf, test, revert, ci, build: "WIP Thi$ is å title"
1: CT1 Title does not follow ConventionalCommits.org format 'type(optional-scope): description': "WIP Thi$ is å title"
1: T5 Title contains the word 'WIP' (case-insensitive): "WIP Thi$ is å title"
diff --git a/qa/expected/test_contrib/test_contrib_rules_with_config_1 b/qa/expected/test_contrib/test_contrib_rules_with_config_1
index 21d467a..d5b5cf8 100644
--- a/qa/expected/test_contrib/test_contrib_rules_with_config_1
+++ b/qa/expected/test_contrib/test_contrib_rules_with_config_1
@@ -1,4 +1,4 @@
-1: CC1 Body does not contain a 'Signed-Off-By' line
+1: CC1 Body does not contain a 'Signed-off-by' line
1: CT1 Title does not start with one of föo, bår: "WIP Thi$ is å title"
1: CT1 Title does not follow ConventionalCommits.org format 'type(optional-scope): description': "WIP Thi$ is å title"
1: T5 Title contains the word 'WIP' (case-insensitive): "WIP Thi$ is å title"
diff --git a/qa/expected/test_user_defined/test_user_defined_rules_examples_1 b/qa/expected/test_user_defined/test_user_defined_rules_examples_1
index 9d00445..44add31 100644
--- a/qa/expected/test_user_defined/test_user_defined_rules_examples_1
+++ b/qa/expected/test_user_defined/test_user_defined_rules_examples_1
@@ -1,5 +1,5 @@
1: T5 Title contains the word 'WIP' (case-insensitive): "WIP: Thi$ is å title"
-1: UC2 Body does not contain a 'Signed-Off-By' line
+1: UC2 Body does not contain a 'Signed-off-by' line
1: UC3 Branch name 'master' does not start with one of ['feature/', 'hotfix/', 'release/']
1: UL1 Title contains the special character '$': "WIP: Thi$ is å title"
2: B4 Second line is not empty: "Content on the second line"
diff --git a/qa/expected/test_user_defined/test_user_defined_rules_examples_2 b/qa/expected/test_user_defined/test_user_defined_rules_examples_2
index 31a9280..11766fc 100644
--- a/qa/expected/test_user_defined/test_user_defined_rules_examples_2
+++ b/qa/expected/test_user_defined/test_user_defined_rules_examples_2
@@ -1,4 +1,4 @@
-1: UC2 Body does not contain a 'Signed-Off-By' line
+1: UC2 Body does not contain a 'Signed-off-by' line
1: UC3 Branch name 'master' does not start with one of ['feature/', 'hotfix/', 'release/']
1: UL1 Title contains the special character '$'
2: B4 Second line is not empty
diff --git a/qa/expected/test_user_defined/test_user_defined_rules_examples_with_config_1 b/qa/expected/test_user_defined/test_user_defined_rules_examples_with_config_1
index a143715..f514f5d 100644
--- a/qa/expected/test_user_defined/test_user_defined_rules_examples_with_config_1
+++ b/qa/expected/test_user_defined/test_user_defined_rules_examples_with_config_1
@@ -1,6 +1,6 @@
1: T5 Title contains the word 'WIP' (case-insensitive): "WIP: Thi$ is å title"
1: UC1 Body contains too many lines (2 > 1)
-1: UC2 Body does not contain a 'Signed-Off-By' line
+1: UC2 Body does not contain a 'Signed-off-by' line
1: UC3 Branch name 'master' does not start with one of ['feature/', 'hotfix/', 'release/']
1: UL1 Title contains the special character '$': "WIP: Thi$ is å title"
2: B4 Second line is not empty: "Content on the second line"
diff --git a/qa/requirements.txt b/qa/requirements.txt
index 32f4662..95d49d4 100644
--- a/qa/requirements.txt
+++ b/qa/requirements.txt
@@ -1,4 +1,4 @@
sh==1.14.1
-pytest==6.1.2;
-arrow==0.17.0;
+pytest==6.2.3;
+arrow==1.0.3;
gitlint # no version as you want to test the currently installed version
diff --git a/qa/test_hooks.py b/qa/test_hooks.py
index 80ccbf6..32abcb0 100644
--- a/qa/test_hooks.py
+++ b/qa/test_hooks.py
@@ -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 = []
@@ -48,7 +48,7 @@ class HookTests(BaseTestCase):
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)
diff --git a/requirements.txt b/requirements.txt
index 0a164bf..578c38a 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,5 @@
setuptools
-wheel==0.35.1
+wheel==0.36.2
Click==7.1.2
sh==1.14.1; sys_platform != 'win32' # sh is not supported on windows
-arrow==0.17.0
+arrow==1.0.3
diff --git a/setup.py b/setup.py
index 3220f82..4f4e269 100644
--- a/setup.py
+++ b/setup.py
@@ -60,7 +60,7 @@ setup(
python_requires=">=3.6",
install_requires=[
'Click==7.1.2',
- 'arrow==0.17.0',
+ 'arrow==1.0.3',
],
extras_require={
':sys_platform != "win32"': [
diff --git a/test-requirements.txt b/test-requirements.txt
index 10ca287..b766a0b 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -1,8 +1,8 @@
-flake8==3.8.4
-coverage==5.3
-python-coveralls==2.9.2
-radon==4.3.2
+flake8==3.9.1
+coverage==5.5
+python-coveralls==2.9.3
+radon==4.5.0
flake8-polyfill==1.0.2 # Required when installing both flake8 and radon>=4.3.1
-pytest==6.1.2;
-pylint==2.6.0;
+pytest==6.2.3;
+pylint==2.7.4;
-e .