Skip to content

Commit 0efa6ce

Browse files
committed
Fixed the pylint ignored file problem with version 1.7.x
1 parent df71902 commit 0efa6ce

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

git_pylint_commit_hook/commit_hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def _parse_score(pylint_output):
9999

100100

101101
_IGNORE_REGEXT = re.compile(
102-
r'Ignoring entire file \(file\-ignored\)'
102+
r'(Ignoring entire file \(file\-ignored\))|(^0 statements analysed.)'
103103
)
104104

105105

tests.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,3 +195,17 @@ def test_check_ignore(self):
195195
self.assertTrue(commit_hook._check_ignore(text))
196196
text = 'Your code has been rated at 8.51'
197197
self.assertFalse(commit_hook._check_ignore(text))
198+
text = '''Report
199+
======
200+
0 statements analysed.
201+
202+
Statistics by type
203+
------------------'''
204+
self.assertTrue(commit_hook._check_ignore(text))
205+
text = '''Report
206+
======
207+
100 statements analysed.
208+
209+
Statistics by type
210+
------------------'''
211+
self.assertFalse(commit_hook._check_ignore(text))

0 commit comments

Comments
 (0)