Updates to scripts after refactor
- Run black to reformat all the scripts
- Update makefile test targets, pylint, and fix some of the issues found
- Update pxeconfig script for refactored nbhelper
- Add start of inventory script
Change-Id: I5f426ac2da840dc72f07f8a6844e199e47d49135
diff --git a/Makefile b/Makefile
index 8593cc2..08886e3 100644
--- a/Makefile
+++ b/Makefile
@@ -12,13 +12,12 @@
# ansible files is all top-level playbooks
ANSIBLE_PLAYBOOKS ?= $(wildcard *.yml)
-ANSIBLE_ROLES ?= $(wildcard roles/*)
# YAML files, excluding venv and cookiecutter directories
YAML_FILES ?= $(shell find . -type d \( -path "./venv_onfansible" -o -path "./cookiecutters" -o -path "./ansible_collections" -o -path "./roles" -o -path "./inventory/host_vars" \) -prune -o -type f \( -name '*.yaml' -o -name '*.yml' \) -print )
# all files with extensions
-PYTHON_FILES ?= $(wildcard scripts/*.py filter_plugins/*.py lint_rules/*.py cookiecutters/*/hooks/*.py roles/*/filter_plugins/*.py)
+PYTHON_FILES ?= $(wildcard scripts/*.py scripts/*/*.py filter_plugins/*.py lint_rules/*.py cookiecutters/*/hooks/*.py)
.DEFAULT_GOAL := help
.PHONY: test lint yamllint ansiblelint license help
@@ -43,7 +42,7 @@
reuse --root . lint
# Cookiecutter tests
-test: yamllint ansiblelint flake8 pylint black ## run all standard tests
+test: ansiblelint flake8 pylint black ## run all standard tests
yamllint: $(VENV_NAME) ## lint YAML format using yamllint
source ./$</bin/activate ; set -u ;\
@@ -55,17 +54,17 @@
ansiblelint: $(VENV_NAME) ## lint ansible-specific format using ansible-lint
source ./$</bin/activate ; set -u ;\
ansible-lint --version ;\
- ansible-lint -R -v $(ANSIBLE_PLAYBOOKS) $(ANSIBLE_ROLES)
+ ansible-lint -R -v $(ANSIBLE_PLAYBOOKS)
flake8: $(VENV_NAME) ## check python formatting with flake8
source ./$</bin/activate ; set -u ;\
flake8 --version ;\
- flake8 --max-line-length 99 $(PYTHON_FILES)
+ flake8 --max-line-length 99 --per-file-ignores="__init__.py:F401" $(PYTHON_FILES)
pylint: $(VENV_NAME) ## pylint check for python 3 compliance
source ./$</bin/activate ; set -u ;\
pylint --version ;\
- pylint --py3k $(PYTHON_FILES)
+ pylint --rcfile=pylint.ini $(PYTHON_FILES)
black: $(VENV_NAME) ## run black on python files in check mode
source ./$</bin/activate ; set -u ;\