Skip to content

Commit adcda47

Browse files
Unifying all flake8 of .py files in one command, and moving excludes to setup.cfg
1 parent 34e85f0 commit adcda47

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

ci/lint.sh

+1-17
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,7 @@ RET=0
1313

1414
# pandas/_libs/src is C code, so no need to search there.
1515
MSG='Linting .py code' ; echo $MSG
16-
flake8 pandas --filename=*.py --exclude pandas/_libs/src
17-
RET=$(($RET + $?)) ; echo $MSG "DONE"
18-
19-
MSG='Linting setup.py' ; echo $MSG
20-
flake8 setup.py
21-
RET=$(($RET + $?)) ; echo $MSG "DONE"
22-
23-
MSG='Linting scripts' ; echo $MSG
24-
flake8 scripts --filename=*.py
25-
RET=$(($RET + $?)) ; echo $MSG "DONE"
26-
27-
MSG='Linting asv benchmarks' ; echo $MSG
28-
flake8 asv_bench/benchmarks/ --exclude=asv_bench/benchmarks/*.py
29-
RET=$(($RET + $?)) ; echo $MSG "DONE"
30-
31-
MSG='Linting doc scripts' ; echo $MSG
32-
flake8 doc/make.py doc/source/conf.py
16+
flake8 .
3317
RET=$(($RET + $?)) ; echo $MSG "DONE"
3418

3519
MSG='Linting .pyx code' ; echo $MSG

ci/print_versions.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ def show_versions(as_json=False):
1818
from optparse import OptionParser
1919
parser = OptionParser()
2020
parser.add_option("-j", "--json", metavar="FILE", nargs=1,
21-
help="Save output as JSON into file, pass in '-' to output to stdout")
21+
help="Save output as JSON into file, "
22+
"pass in '-' to output to stdout")
2223

2324
(options, args) = parser.parse_args()
2425

setup.cfg

+8-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ tag_prefix = v
1212
parentdir_prefix = pandas-
1313

1414
[flake8]
15+
max-line-length = 79
1516
ignore =
1617
W503, # line break before binary operator
1718
E402, # module level import not at top of file
@@ -21,7 +22,13 @@ ignore =
2122
C406, # Unnecessary list literal - rewrite as a dict literal.
2223
C408, # Unnecessary dict call - rewrite as a literal.
2324
C409 # Unnecessary list passed to tuple() - rewrite as a tuple literal.
24-
max-line-length = 79
25+
exclude =
26+
asv_bench/*.py, # TODO we should fix linting in those files instead of excluding
27+
doc/sphinxext/*.py,
28+
doc/build/*.py,
29+
doc/temp/*.py,
30+
.eggs/*.py,
31+
versioneer.py
2532

2633
[yapf]
2734
based_on_style = pep8

0 commit comments

Comments
 (0)