Refactor to make pylint happy

This commit is contained in:
2025-09-23 01:12:49 -04:00
parent 29bfd07dad
commit 43cd162313
4 changed files with 767 additions and 408 deletions

View File

@@ -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