mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-12 05:54:18 +00:00
Fix pylint.
This commit is contained in:
parent
f961d8f5e1
commit
00d5904b80
2 changed files with 7 additions and 7 deletions
|
|
@ -10,9 +10,9 @@ def validate_files(argv):
|
||||||
retcode = 0
|
retcode = 0
|
||||||
for filename in argv:
|
for filename in argv:
|
||||||
if (
|
if (
|
||||||
not filename.endswith('_test.py') and
|
not filename.endswith('_test.py') and
|
||||||
not filename.endswith('__init__.py') and
|
not filename.endswith('__init__.py') and
|
||||||
not filename.endswith('/conftest.py')
|
not filename.endswith('/conftest.py')
|
||||||
):
|
):
|
||||||
retcode = 1
|
retcode = 1
|
||||||
print('{0} does not end in _test.py'.format(filename))
|
print('{0} does not end in _test.py'.format(filename))
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ from pre_commit_hooks.trailing_whitespace_fixer import fix_trailing_whitespace
|
||||||
def test_fixes_trailing_whitespace(tmpdir):
|
def test_fixes_trailing_whitespace(tmpdir):
|
||||||
with local.cwd(tmpdir.strpath):
|
with local.cwd(tmpdir.strpath):
|
||||||
for filename, contents in (
|
for filename, contents in (
|
||||||
('foo.py', 'foo \nbar \n'),
|
('foo.py', 'foo \nbar \n'),
|
||||||
('bar.py', 'bar\t\nbaz\t\n'),
|
('bar.py', 'bar\t\nbaz\t\n'),
|
||||||
):
|
):
|
||||||
with open(filename, 'w') as f:
|
with open(filename, 'w') as f:
|
||||||
f.write(contents) # pragma: no cover (python 2.6 coverage bug)
|
f.write(contents) # pragma: no cover (python 2.6 coverage bug)
|
||||||
|
|
@ -16,8 +16,8 @@ def test_fixes_trailing_whitespace(tmpdir):
|
||||||
assert ret == 1
|
assert ret == 1
|
||||||
|
|
||||||
for filename, after_contents in (
|
for filename, after_contents in (
|
||||||
('foo.py', 'foo\nbar\n'),
|
('foo.py', 'foo\nbar\n'),
|
||||||
('bar.py', 'bar\nbaz\n'),
|
('bar.py', 'bar\nbaz\n'),
|
||||||
):
|
):
|
||||||
assert open(filename).read() == after_contents
|
assert open(filename).read() == after_contents
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue