1515#
16161717
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
2019# make pylint to check Python code for enhanced compliance including naming
2120# and documentation
2221# make coverage-report to check coverage of the python scripts by the tests
@@ -27,7 +26,8 @@ PACKAGE=schema-salad
2726# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2827# `[[` conditional expressions.
2928PYSOURCES =$(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
3131COVBASE =coverage run --branch --append --source=${MODULE} \
3232 --omit=schema_salad/tests/*
3333
@@ -73,19 +73,6 @@ clean: FORCE
7373sort_imports :
7474 isort ${MODULE} /* .py ${MODULE} /tests/* .py setup.py
7575
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-
8976pep257 : pydocstyle
9077# # pydocstyle : check Python code style
9178pydocstyle : $(PYSOURCES )
@@ -97,14 +84,9 @@ pydocstyle_report.txt: $(PYSOURCES)
9784diff_pydocstyle_report : pydocstyle_report.txt
9885 diff-quality --violations=pycodestyle --fail-under=100 $^
9986
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
10890
10991# # pylint : run static code analysis on Python code
11092pylint : $(PYSOURCES )
@@ -206,7 +188,7 @@ jenkins: FORCE
206188 . env/bin/activate ; \
207189 pip install -U setuptools pip wheel ; \
208190 ${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
210192 if ! test -d env3 ; then virtualenv -p python3 env3 ; fi
211193 . env3/bin/activate ; \
212194 pip install -U setuptools pip wheel ; \
0 commit comments