Makefile: consolidate precommit and check targets

Signed-off-by: David Aguilar <davvid@gmail.com>
This commit is contained in:
David Aguilar
2018-11-21 19:39:33 -08:00
parent 217952d6b0
commit cba3f20fa9
3 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ to this software.
## Run the pre-commit checks before committing
* `make precommit`
* `make check`
## Be picky about whitespace
+12 -11
View File
@@ -10,9 +10,9 @@ all::
# make flake8 # python style checks
# make pylint [color=1] # run pylint; color=1 colorizes output
# make pylint3k [color=1] # run python2+3 compatibility checks
# make check file=<filename> # run precommit checks on <filename>
# make format file=<filename> # run the yapf python formatter on <filename>
# make precommit [color=1] # run test, doc, flake8, pylint3k, and pylint
# make check [color=1] # run test, doc, flake8, pylint3k, and pylint
# make check file=<filename> # run checks on <filename>
#
# Release Prep
# ------------
@@ -285,21 +285,22 @@ pylint:
$(PYTHON_SOURCES) $(ALL_PYTHON_DIRS)
.PHONY: pylint
# Pre-commit checks
ifdef file
check:
$(FLAKE8) $(FLAKE8_FLAGS) $(flags) $(file)
$(PYLINT) $(PYLINT_FLAGS) --output-format=colorized $(flags) $(file)
$(PYLINT) $(PYLINT_FLAGS) --output-format=colorized --py3k $(flags) $(file)
else
check:: all
check:: test
check:: doc
check:: flake8
check:: pylint3k
check:: pylint
endif
.PHONY: check
# Pre-commit checks
precommit:: all
precommit:: doc
precommit:: test
precommit:: flake8
precommit:: pylint3k
precommit:: pylint
.PHONY: precommit
format:
$(YAPF) --in-place $(flags) $(file)
.PHONY: format
+2 -2
View File
@@ -321,8 +321,8 @@ The following commands should be run during development:
# Run the unit tests
$ make test
# Check for pylint and flake8 warnings
$ make precommit
# Run tests and longer-running pylint and flake8 checks
$ make check
# Run tests against multiple python interpretors using tox
$ make tox