15
15
#
16
16
17
17
18
- # make pycodestyle to check for basic Python code compliance
19
- # make autopep8 to fix most pep8 errors
18
+ # make format to fix most python formatting errors
20
19
# make pylint to check Python code for enhanced compliance including naming
21
20
# and documentation
22
21
# make coverage-report to check coverage of the python scripts by the tests
@@ -27,7 +26,8 @@ PACKAGE=schema-salad
27
26
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
28
27
# `[[` conditional expressions.
29
28
PYSOURCES =$(wildcard ${MODULE}/** .py tests/* .py) setup.py
30
- DEVPKGS =pycodestyle diff_cover autopep8 pylint coverage pep257 pytest-xdist flake8
29
+ DEVPKGS =diff_cover black pylint coverage pep257 pytest-xdist \
30
+ flake8 flake8-bugbear
31
31
COVBASE =coverage run --branch --append --source=${MODULE} \
32
32
--omit=schema_salad/tests/*
33
33
@@ -73,19 +73,6 @@ clean: FORCE
73
73
sort_imports :
74
74
isort ${MODULE} /* .py ${MODULE} /tests/* .py setup.py
75
75
76
- pep8 : pycodestyle
77
- # # pycodestyle : check Python code style
78
- pycodestyle : $(PYSOURCES )
79
- pycodestyle --exclude=_version.py --show-source --show-pep8 $^ || true
80
-
81
- pep8_report.txt : pycodestyle_report.txt
82
- pycodestyle_report.txt : $(PYSOURCES )
83
- pycodestyle --exclude=_version.py $^ > $@ || true
84
-
85
- diff_pep8_report : diff_pycodestyle_report
86
- diff_pycodestyle_report : pycodestyle_report.txt
87
- diff-quality --violations=pycodestyle $^
88
-
89
76
pep257 : pydocstyle
90
77
# # pydocstyle : check Python code style
91
78
pydocstyle : $(PYSOURCES )
@@ -97,14 +84,9 @@ pydocstyle_report.txt: $(PYSOURCES)
97
84
diff_pydocstyle_report : pydocstyle_report.txt
98
85
diff-quality --violations=pycodestyle --fail-under=100 $^
99
86
100
- # # autopep8 : fix most Python code indentation and formatting
101
- autopep8 : $(PYSOURCES )
102
- autopep8 --recursive --in-place --ignore E309 $^
103
-
104
- # A command to automatically run astyle and autopep8 on appropriate files
105
- # # format : check/fix all code indentation and formatting (runs autopep8)
106
- format : autopep8
107
- # Do nothing
87
+ # # format : check/fix all code indentation and formatting (runs black)
88
+ format :
89
+ black --target-version py27 schema_salad
108
90
109
91
# # pylint : run static code analysis on Python code
110
92
pylint : $(PYSOURCES )
@@ -206,7 +188,7 @@ jenkins: FORCE
206
188
. env/bin/activate ; \
207
189
pip install -U setuptools pip wheel ; \
208
190
${MAKE} install-dep coverage.html coverage.xml pydocstyle_report.txt \
209
- sloccount.sc pycodestyle_report.txt pylint_report.txt
191
+ sloccount.sc pylint_report.txt
210
192
if ! test -d env3 ; then virtualenv -p python3 env3 ; fi
211
193
. env3/bin/activate ; \
212
194
pip install -U setuptools pip wheel ; \
0 commit comments