diff --git a/.flake8 b/.flake8 index 2b20931..ca2967e 100644 --- a/.flake8 +++ b/.flake8 @@ -28,6 +28,8 @@ ignore = E128, # unexpected indentation E116, + # continuation line unaligned for hanging indent + E131, # too many blank lines E303, # missing whitespace around arithmetic operator diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d542b3e..6043593 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,11 @@ repos: additional_dependencies: - tomli + - repo: https://github.com/pycqa/flake8 + rev: 7.1.2 + hooks: + - id: flake8 + - repo: https://github.com/tox-dev/pyproject-fmt rev: v2.5.1 hooks: diff --git a/cpplint_unittest.py b/cpplint_unittest.py index 08eb375..c0a4010 100755 --- a/cpplint_unittest.py +++ b/cpplint_unittest.py @@ -231,6 +231,7 @@ def PerformIncludeWhatYouUse(self, code, filename='foo.h', io=codecs): # Perform lint and make sure one of the errors is what we want def TestLintContains(self, code, expected_message): self.assertTrue(expected_message in self.PerformSingleLineLint(code)) + def TestLintNotContains(self, code, expected_message): self.assertFalse(expected_message in self.PerformSingleLineLint(code)) @@ -1150,7 +1151,7 @@ def testIncludeWhatYouUse(self): """#include "base/foobar.h" boost::range::transform(input, std::back_inserter(output), square); """, - '') # Avoid false positives on transform in other namespaces. + '') # Avoid false positives on transform in other namespaces. self.TestIncludeWhatYouUse( """#include "base/foobar.h" bool foobar = std::min_element(a.begin(), a.end()); diff --git a/pyproject.toml b/pyproject.toml index 91f944a..b6236e8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ classifiers = [ dependencies = [ ] optional-dependencies.dev = [ - "flake8>=4.0.1", "parameterized", "pylint>=2.11", "pytest", diff --git a/tox.ini b/tox.ini index 1fc6c00..db55440 100644 --- a/tox.ini +++ b/tox.ini @@ -8,4 +8,3 @@ extras = dev commands = {envpython} -m pytest {posargs:} {envpython} -m pylint cpplint.py - {envpython} -m flake8 cpplint.py