Skip to content

Commit d8f5e56

Browse files
Add plyint back to travis and fix pylint errors
1 parent 2cea42b commit d8f5e56

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

.travis.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@ python:
1414
- "pypy3"
1515

1616
install:
17-
- pip install pyflakes
17+
- pip install pylint pyflakes
1818
# command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
1919
# install: "sudo apt-get install"
2020
# command to run tests, e.g. python setup.py test
2121
script:
2222
- python cpplint_unittest.py
2323
- python cpplint_clitest.py
24-
- pyflakes cpplint.py
24+
- python cpplint.py --help
25+
2526
- pyflakes cpplint_unittest.py
26-
- pyflakes cpplint_clitest.py
27+
- pyflakes cpplint_clitest.py
28+
- pyflakes cpplint.py
29+
30+
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pylint --max-locals=25 --max-line-length=100 --max-attributes=10 -d bad-indentation,invalid-name,too-many-statements,multiple-statements,global-statement,missing-docstring,too-many-branches,too-many-return-statements,too-many-arguments,fixme,bad-continuation,bad-option-value,redefined-builtin,too-few-public-methods,no-self-use,too-many-lines,too-many-function-args,unused-argument,anomalous-unicode-escape-in-string,too-many-boolean-expressions cpplint.py; fi
31+
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pylint --max-locals=25 --max-line-length=100 --max-attributes=10 -d bad-indentation,invalid-name,too-many-statements,multiple-statements,global-statement,missing-docstring,too-many-branches,too-many-return-statements,too-many-arguments,fixme,bad-continuation,bad-option-value,redefined-builtin,too-few-public-methods,no-self-use,too-many-lines,too-many-function-args,unused-argument,anomalous-unicode-escape-in-string,too-many-boolean-expressions cpplint_clitest.py; fi
32+
- if [[ $TRAVIS_PYTHON_VERSION != 2.6 ]]; then pylint --max-locals=25 --max-line-length=120 --max-attributes=10 --max-public-methods=200 -d bad-indentation,invalid-name,too-many-statements,multiple-statements,global-statement,missing-docstring,too-many-branches,too-many-return-statements,too-many-arguments,fixme,bad-continuation,bad-option-value,redefined-builtin,too-few-public-methods,no-self-use,too-many-lines,too-many-function-args,unused-argument,protected-access,unused-variable,global-at-module-level,anomalous-unicode-escape-in-string cpplint_unittest.py; fi

cpplint_clitest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ class UsageTest(unittest.TestCase):
6161
def testHelp(self):
6262
(status, out, err) = RunShellCommand(BASE_CMD + ' --help')
6363
self.assertEqual(0, status)
64+
self.assertEqual(b'', out)
6465
self.assertTrue(err.startswith(b'\nSyntax: cpplint'))
6566

6667

@@ -69,7 +70,8 @@ class SignatureTests(unittest.TestCase):
6970
Regression tests: The test starts a filetreewalker scanning for files name *.def
7071
Such files are expected to have as first line the argument
7172
to a cpplint invocation from within the same directory, as second line the
72-
expected status code, and all other lines the expected systemerr output (two blank lines at end).
73+
expected status code, and all other lines the expected systemerr output (two blank
74+
lines at end).
7375
"""
7476

7577
def testChromiumSample(self):
@@ -89,12 +91,12 @@ def testProtobufSample(self):
8991

9092
def testCodeliteSample(self):
9193
self.checkAllInFolder('./samples/codelite-sample', 1)
92-
94+
9395
def checkAllInFolder(self, foldername, expectedDefs):
9496
# uncomment to show complete diff
9597
# self.maxDiff = None
9698
count = 0
97-
for dirpath, dnames, fnames in os.walk(foldername):
99+
for dirpath, _, fnames in os.walk(foldername):
98100
for f in fnames:
99101
if f.endswith('.def'):
100102
count += 1

0 commit comments

Comments
 (0)