2020# and documentation
2121# make coverage-report to check coverage of the python scripts by the tests
2222
23- MODULE =cwlupgrader
23+ MODULE =cwl-upgrader
24+ PACKAGE =cwlupgrader
2425
2526# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2627# `[[` conditional expressions.
2728PYSOURCES =$(wildcard cwlupgrader/** .py tests/* .py) setup.py
2829DEVPKGS =diff_cover black pylint coverage pep257 pytest-xdist \
29- flake8-bugbear pytest isort flake8
30+ flake8 flake8 -bugbear pyupgrade mypy
3031DEBDEVPKGS =pylint python3-coverage sloccount \
3132 python3-flake8 shellcheck
3233VERSION =1.0.$(shell date +% Y% m% d% H% M% S --utc --date=`git log --first-parent \
@@ -68,7 +69,7 @@ clean: FORCE
6869# Linting and code style related targets
6970# # sorting imports using isort: https://github.com/timothycrosley/isort
7071sort_imports :
71- isort ${MODULE } /* .py tests/* .py setup.py
72+ isort ${PACKAGE } /* .py tests/* .py setup.py
7273
7374pep257 : pydocstyle
7475# # pydocstyle : check Python code style
@@ -79,7 +80,7 @@ pydocstyle_report.txt: $(PYSOURCES)
7980 pydocstyle setup.py $^ > $@ 2>&1 || true
8081
8182diff_pydocstyle_report : pydocstyle_report.txt
82- diff-quality --violations=pycodestyle --fail-under=100 $^
83+ diff-quality --compare-branch=main -- violations=pycodestyle --fail-under=100 $^
8384
8485# # format : check/fix all code indentation and formatting (runs black)
8586format :
@@ -95,7 +96,7 @@ pylint_report.txt: ${PYSOURCES}
9596 $^ -j0> $@ || true
9697
9798diff_pylint_report : pylint_report.txt
98- diff-quality --violations=pylint pylint_report.txt
99+ diff-quality --compare-branch main -- violations=pylint pylint_report.txt
99100
100101.coverage : testcov
101102
@@ -115,18 +116,18 @@ coverage-report: .coverage
115116 coverage report
116117
117118diff-cover : coverage.xml
118- diff-cover $^
119+ diff-cover --compare-branch main $^
119120
120121diff-cover.html : coverage.xml
121- diff-cover $^ --html-report $@
122+ diff-cover --compare-branch main $^ --html-report $@
122123
123124# # test : run the ${MODULE} test suite
124125test : FORCE
125126 python setup.py test
126127
127128# # testcov : run the ${MODULE} test suite and collect coverage
128129testcov : $(pysources )
129- python setup.py test --addopts " --cov ${MODULE } "
130+ python setup.py test --addopts " --cov ${PACKAGE } "
130131
131132sloccount.sc : ${PYSOURCES} Makefile
132133 sloccount --duplicates --wide --details $^ > $@
@@ -149,7 +150,10 @@ mypy: ${PYSOURCES}
149150 fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
150151 MYPYPATH=$$ MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
151152 --warn-redundant-casts \
152- ${MODULE}
153+ ${PACKAGE}
154+
155+ pyupgrade : $(filter-out schema_salad/metaschema.py,${PYSOURCES})
156+ pyupgrade --exit-zero-even-if-changed --py36-plus $^
153157
154158release : FORCE
155159 ./release-test.sh
0 commit comments