Refactor to make pylint happy
This commit is contained in:
14
Makefile
14
Makefile
@@ -38,7 +38,7 @@ SUPPORTED := ubuntu-20.04 \
|
||||
# These targets are the main ones to use for most things.
|
||||
##
|
||||
|
||||
.PHONY: all clean tgz test query-tests install-common install-openrc install-systemd
|
||||
.PHONY: all clean tgz lint format test query-tests install-common install-openrc install-systemd
|
||||
|
||||
all: package-all
|
||||
|
||||
@@ -80,6 +80,18 @@ tgz:
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)
|
||||
|
||||
# Check for lint
|
||||
lint:
|
||||
pylint src/pgmon.py
|
||||
pylint src/test_pgmon.py
|
||||
black --check --diff src/pgmon.py
|
||||
black --check --diff src/test_pgmon.py
|
||||
|
||||
# Format the code using black
|
||||
format:
|
||||
black src/pgmon.py
|
||||
black src/test_pylint.py
|
||||
|
||||
# Run unit tests for the script
|
||||
test:
|
||||
cd src ; python3 -m unittest
|
||||
|
||||
Reference in New Issue
Block a user