Skip to content

Commit 4dd6b5e

Browse files
committed
Makefile updates
1 parent a760fc2 commit 4dd6b5e

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

Makefile

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,68 +34,76 @@ DEBDEVPKGS=pylint python3-coverage sloccount \
3434
python3-flake8 shellcheck
3535
VERSION=1.2.3 # please also update setup.py
3636

37-
## all : default task
37+
## all : default task (install cwl-upgrader in dev mode)
3838
all: dev
3939

40-
## help : print this help message and exit
40+
## help : print this help message and exit
4141
help: Makefile
4242
@sed -n 's/^##//p' $<
4343

44-
## install-dep : install most of the development dependencies via pip
44+
## cleanup : shortcut for "make sort_imports format flake8 diff_pydocstyle_report"
45+
cleanup: sort_imports format flake8 diff_pydocstyle_report
46+
47+
## install-dep : install most of the development dependencies via pip
4548
install-dep: install-dependencies
4649

4750
install-dependencies: FORCE
4851
pip install --upgrade $(DEVPKGS)
4952
pip install -r requirements.txt -r mypy-requirements.txt
5053

51-
## install : install the ${MODULE} module and script(s)
54+
## install : install the cwlupgrader package and scripts
5255
install: FORCE
5356
pip install .$(EXTRAS)
5457

55-
## dev : install the ${MODULE} module in dev mode
58+
## dev : install the cwlupgrader package in dev mode
5659
dev: install-dep
5760
pip install -e .$(EXTRAS)
5861

59-
## dist : create a module package for distribution
62+
## dist : create a module package for distribution
6063
dist: dist/${MODULE}-$(VERSION).tar.gz
6164

6265
dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
6366
python setup.py sdist bdist_wheel
6467

65-
## clean : clean up all temporary / machine-generated files
68+
## clean : clean up all temporary / machine-generated files
6669
clean: FORCE
6770
rm -f ${MODILE}/*.pyc tests/*.pyc
6871
python setup.py clean --all || true
6972
rm -Rf .coverage
7073
rm -f diff-cover.html
7174

7275
# Linting and code style related targets
73-
## sorting imports using isort: https://github.com/timothycrosley/isort
76+
## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
7477
sort_imports: $(PYSOURCES)
7578
isort $^
7679

7780
remove_unused_imports: $(PYSOURCES)
7881
autoflake --in-place --remove-all-unused-imports $^
7982

8083
pep257: pydocstyle
81-
## pydocstyle : check Python code style
84+
## pydocstyle : check Python docstring style
8285
pydocstyle: $(PYSOURCES)
8386
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
8487

8588
pydocstyle_report.txt: $(PYSOURCES)
8689
pydocstyle setup.py $^ > $@ 2>&1 || true
8790

91+
## diff_pydocstyle_report : check Python docstring style for changed files only
8892
diff_pydocstyle_report: pydocstyle_report.txt
89-
diff-quality --compare-branch=main --violations=pycodestyle --fail-under=100 $^
93+
diff-quality --compare-branch=main --violations=pydocstyle --fail-under=100 $^
94+
95+
## codespell : check for common misspellings
96+
codespell:
97+
codespell -w $(shell git ls-files | grep -v mypy-stubs | grep -v gitignore | grep -v EDAM.owl | grep -v pre.yml | grep -v test_schema)
9098

91-
## format : check/fix all code indentation and formatting (runs black)
99+
## format : check/fix all code indentation and formatting (runs black)
92100
format:
93101
black setup.py cwlupgrader tests
94102

95103
format-check:
96104
black --diff --check cwlupgrader setup.py
97105

98-
## pylint : run static code analysis on Python code
106+
## pylint : run static code analysis on Python code
99107
pylint: $(PYSOURCES)
100108
pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
101109
$^ -j0|| true
@@ -105,7 +113,7 @@ pylint_report.txt: $(PYSOURCES)
105113
$^ -j0> $@ || true
106114

107115
diff_pylint_report: pylint_report.txt
108-
diff-quality --compare-branch main --violations=pylint pylint_report.txt
116+
diff-quality --compare-branch=main --violations=pylint pylint_report.txt
109117

110118
.coverage: testcov
111119

@@ -125,23 +133,23 @@ coverage-report: .coverage
125133
coverage report
126134

127135
diff-cover: coverage.xml
128-
diff-cover --compare-branch main $^
136+
diff-cover --compare-branch=main $^
129137

130138
diff-cover.html: coverage.xml
131139
diff-cover --compare-branch main $^ --html-report $@
132140

133-
## test : run the ${MODULE} test suite
141+
## test : run the cwlupgrader test suite
134142
test: $(PYSOURCES)
135-
python setup.py test
143+
python -m pytest -rs
136144

137-
## testcov : run the ${MODULE} test suite and collect coverage
145+
## testcov : run the cwlupgrader test suite and collect coverage
138146
testcov: $(PYSOURCES)
139147
python setup.py test --addopts "--cov" ${PYTEST_EXTRA}
140148

141149
sloccount.sc: $(PYSOURCES) Makefile
142150
sloccount --duplicates --wide --details $^ > $@
143151

144-
## sloccount : count lines of code
152+
## sloccount : count lines of code
145153
sloccount: $(PYSOURCES) Makefile
146154
sloccount $^
147155

@@ -163,7 +171,7 @@ pyupgrade: $(PYSOURCES)
163171
pyupgrade --exit-zero-even-if-changed --py36-plus $^
164172

165173
release-test: FORCE
166-
git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )
174+
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
167175
./release-test.sh
168176

169177
release: release-test

0 commit comments

Comments
 (0)