Merging upstream version 0.19.1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
61e6dccee9
commit
2efee3d3ab
111 changed files with 2058 additions and 1676 deletions
|
@ -1,10 +1,9 @@
|
|||
# pylint: disable=too-many-function-args,unexpected-keyword-arg
|
||||
import re
|
||||
|
||||
import arrow
|
||||
|
||||
from qa.shell import echo, git, gitlint
|
||||
from qa.base import BaseTestCase
|
||||
from qa.shell import echo, git, gitlint
|
||||
|
||||
|
||||
class CommitsTests(BaseTestCase):
|
||||
|
@ -111,6 +110,11 @@ class CommitsTests(BaseTestCase):
|
|||
self.assertEqual(output.exit_code, 2)
|
||||
self.assertEqualStdout(output, expected)
|
||||
|
||||
# Lint using --commits <commit sha>,
|
||||
output = gitlint("--commits", f"{commit_sha},", _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[2])
|
||||
self.assertEqual(output.exit_code, 2)
|
||||
self.assertEqualStdout(output, expected)
|
||||
|
||||
# Lint a single commit using --commits <refspec> pointing to the single commit
|
||||
output = gitlint("--commits", refspec, _cwd=self.tmp_git_repo, _tty_in=True, _ok_code=[2])
|
||||
self.assertEqual(output.exit_code, 2)
|
||||
|
@ -129,7 +133,7 @@ class CommitsTests(BaseTestCase):
|
|||
self.assertEqual(output.exit_code, 254)
|
||||
|
||||
def test_lint_staged_stdin(self):
|
||||
"""Tests linting a staged commit. Gitint should lint the passed commit message andfetch additional meta-data
|
||||
"""Tests linting a staged commit. Gitint should lint the passed commit message and fetch additional meta-data
|
||||
from the underlying repository. The easiest way to test this is by inspecting `--debug` output.
|
||||
This is the equivalent of doing:
|
||||
echo "WIP: Pïpe test." | gitlint --staged --debug
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue