Skip to content

Commit

Permalink
Move pycodestyle config to setup.cfg and constrain the files that it …
Browse files Browse the repository at this point in the history
…gets applied to.
  • Loading branch information
scoder committed Feb 23, 2019
1 parent ff75c96 commit dad0100
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
8 changes: 5 additions & 3 deletions runtests.py
Original file line number Diff line number Diff line change
Expand Up @@ -1586,10 +1586,12 @@ def __init__(self, cython_dir):

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)
Expand Down
9 changes: 7 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 0 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit dad0100

Please sign in to comment.