summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2019-02-23 11:23:13 +0100
committerStefan Behnel <stefan_ml@behnel.de>2019-02-23 11:23:13 +0100
commitdad0100c14d53ed2faae8dd93d48e164263a3324 (patch)
treeb6af8a40a70b28e0f781d7e74fa6d2bdd5f458d9
parentff75c96615b91ce2aa6f25c94cc831834bae98f9 (diff)
downloadcython-dad0100c14d53ed2faae8dd93d48e164263a3324.tar.gz
Move pycodestyle config to setup.cfg and constrain the files that it gets applied to.
-rwxr-xr-xruntests.py8
-rw-r--r--setup.cfg9
-rw-r--r--tox.ini6
3 files changed, 12 insertions, 11 deletions
diff --git a/runtests.py b/runtests.py
index f98c17bf8..f52a698b3 100755
--- a/runtests.py
+++ b/runtests.py
@@ -1586,10 +1586,12 @@ class TestCodeFormat(unittest.TestCase):
def runTest(self):
import pycodestyle
- config_file = os.path.join(self.cython_dir, "tox.ini")
+ config_file = os.path.join(self.cython_dir, "setup.cfg")
if not os.path.exists(config_file):
- config_file=os.path.join(os.path.dirname(__file__), "tox.ini")
- paths = glob.glob(os.path.join(self.cython_dir, "**/*.py"), recursive=True)
+ config_file=os.path.join(os.path.dirname(__file__), "setup.cfg")
+ paths = []
+ for codedir in ['Cython', 'Demos', 'docs', 'pyximport', 'tests']:
+ paths += glob.glob(os.path.join(self.cython_dir, codedir + "/**/*.py"), recursive=True)
style = pycodestyle.StyleGuide(config_file=config_file)
print("") # Fix the first line of the report.
result = style.check_files(paths)
diff --git a/setup.cfg b/setup.cfg
index d9cb32c35..4ac5ece66 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,7 +1,12 @@
[flake8]
-exclude = .git,build,__pycache__
max-complexity = 10
-max-line-length = 120
+
+[pycodestyle]
+exclude = .git,build,__pycache__,venv*,TEST*
+max-line-length = 150
+format = pylint
+select = E711, E714, E501, W291
+#ignore = W, E
ignore =
W504,
# W504 line break after binary operator
diff --git a/tox.ini b/tox.ini
index 5f86476f6..5d47008ed 100644
--- a/tox.ini
+++ b/tox.ini
@@ -10,9 +10,3 @@ envlist = py26, py27, py32, py33, py34, pypy
setenv = CFLAGS=-O0 -ggdb
commands =
{envpython} runtests.py -vv
-
-[pycodestyle]
-ignore = W, E
-select = E711, E714, E501, W291
-max-line-length = 150
-format = pylint