Skip to content

Commit 4199c98

Browse files
Prepare black formatting: update flake8 config + add to CI code checks
1 parent b3d3ce7 commit 4199c98

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed

ci/code_checks.sh

+7
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ fi
5252
### LINTING ###
5353
if [[ -z "$CHECK" || "$CHECK" == "lint" ]]; then
5454

55+
echo "black --version"
56+
black --version
57+
58+
MSG='Checking black formatting' ; echo $MSG
59+
black . --check
60+
RET=$(($RET + $?)) ; echo $MSG "DONE"
61+
5562
# `setup.cfg` contains the list of error codes that are being ignored in flake8
5663

5764
echo "flake8 --version"

environment.yml

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ dependencies:
1616
- cython>=0.28.2
1717

1818
# code checks
19+
- black
1920
- cpplint
2021
- flake8
2122
- flake8-comprehensions # used by flake8, linting of unnecessary comprehensions

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ python-dateutil>=2.6.1
33
pytz
44
asv
55
cython>=0.28.2
6+
black
67
cpplint
78
flake8
89
flake8-comprehensions

setup.cfg

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

1414
[flake8]
15-
max-line-length = 79
15+
max-line-length = 88
1616
ignore =
17+
E501, # longer line length
18+
E203, # space before : (needed for how black formats slicing)
1719
W503, # line break before binary operator
1820
W504, # line break after binary operator
1921
E402, # module level import not at top of file
@@ -113,9 +115,12 @@ sections=FUTURE,STDLIB,THIRDPARTY,PRE_LIBS,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,
113115

114116
known_first_party=pandas
115117
known_third_party=Cython,numpy,dateutil,matplotlib,python-dateutil,pytz,pyarrow,pytest
116-
multi_line_output=4
118+
119+
multi_line_output=3
120+
include_trailing_comma=True
117121
force_grid_wrap=0
118122
combine_as_imports=True
123+
line_length=88
119124
force_sort_within_sections=True
120125
skip_glob=env,
121126
skip=

0 commit comments

Comments
 (0)