Files
ansible-freeipa/utils/lint_check.sh
Rafael Guterres Jeffman ce8487e394 pylint: Enable pylint for ansible-freeipa roles.
This patch enables pylint evaluation for ansible-freeipa roles in
both the local script 'utils/lint-check.sh' and in upstream CI.
2022-01-12 12:09:46 -03:00

44 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
INFO="\033[37;1m"
WARN="\033[33;1m"
RST="\033[0m"
topdir=$(dirname "$0")
pushd "${topdir}/.." >/dev/null 2>&1 || exit 1
echo -e "${INFO}Running 'flake8'...${RST}"
flake8 plugins utils roles setup.py
echo -e "${INFO}Running 'pydocstyle'...${RST}"
pydocstyle plugins utils roles setup.py
echo -e "${INFO}Running 'pylint'...${RST}"
pylint plugins roles setup.py
ANSIBLE_LIBRARY="${ANSIBLE_LIBRARY:-plugins/modules}"
ANSIBLE_MODULE_UTILS="${ANSIBLE_MODULE_UTILS:-plugins/module_utils}"
ANSIBLE_DOC_FRAGMENT_PLUGINS="${ANSIBLE_DOC_FRAGMENT_PLUGINS:-plugins/doc_fragments}"
export ANSIBLE_LIBRARY ANSIBLE_MODULE_UTILS ANSIBLE_DOC_FRAGMENT_PLUGINS
echo -e "${WARN}Missing file warnings are expected and can be ignored.${RST}"
echo -e "${INFO}Running 'ansible-lint'...${RST}"
playbook_dirs=(
"tests"
"playbooks"
)
ansible-lint --force-color "${playbook_dirs[@]}"
echo -e "${INFO}Running 'ansible-doc-test'...${RST}"
python "${topdir}/ansible-doc-test" -v roles plugins
echo -e "${INFO}Running 'yamllint'...${RST}"
yaml_dirs=(
"tests"
"playbooks"
"molecule"
"roles"
)
yamllint -f colored "${yaml_dirs[@]}"
popd >/dev/null 2>&1 || exit 1