Skip to content

Commit 1e7bc91

Browse files
authored
Integration tests: set git config commit.cleanup=verbatim (#447)
Modern git does commit message cleanup by default (e.g. removing trailing whitespace). We disable this during integration testing by setting: git config commit.cleanup=verbatim
1 parent 2c9af78 commit 1e7bc91

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Diff for: qa/base.py

+3
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def create_tmp_git_repo(self):
6969
# http://stackoverflow.com/questions/5581857/git-and-the-umlaut-problem-on-mac-os-x
7070
git("config", "core.precomposeunicode", "true", _cwd=tmp_git_repo)
7171

72+
# Git now does commit message cleanup by default (e.g. removing trailing whitespace), disable that for testing
73+
git("config", "commit.cleanup", "verbatim", _cwd=tmp_git_repo)
74+
7275
return tmp_git_repo
7376

7477
@staticmethod

Diff for: qa/expected/test_user_defined/test_user_defined_rules_examples_2

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
1: UC3 Branch name 'main' does not start with one of ['feature/', 'hotfix/', 'release/']
33
1: UL1 Title contains the special character '$'
44
2: B4 Second line is not empty
5+
3: B3 Line contains hard tab characters (\t)

Diff for: qa/test_user_defined.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_user_defined_rules_examples2(self):
1818
extra_path = self.get_example_path()
1919
commit_msg = "Release: Thi$ is å title\nContent on the second line\n$This line is ignored \nThis isn't\t\n"
2020
self.create_simple_commit(commit_msg)
21-
output = gitlint("--extra-path", extra_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[4])
21+
output = gitlint("--extra-path", extra_path, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[5])
2222
self.assertEqualStdout(output, self.get_expected("test_user_defined/test_user_defined_rules_examples_2"))
2323

2424
def test_user_defined_rules_examples_with_config(self):

0 commit comments

Comments
 (0)