Skip to content
Snippets Groups Projects
Commit b7900f1c authored by Rafael Guterres Jeffman's avatar Rafael Guterres Jeffman
Browse files

Add script to run linters.

The scprit `lint_check.sh` under utils runs the same linters as the
Github Actions, with the same configuration.

The changes on setup.cfg are required if flake8-docstrings is used,
so its output is the same as pydocstlye.
parent 121f59bb
No related branches found
No related tags found
No related merge requests found
......@@ -22,7 +22,8 @@ data_files =
/usr/share/ansible/roles/ipareplica = roles/ipareplica/*
[flake8]
extend-ignore = E203
extend-ignore = E203, D1, D212, D203, D400, D401
exclude = .git,__pycache__,.tox,.venv
per-file-ignores =
plugins/*:E402
roles/*:E402
......
#!/bin/bash
topdir=`dirname $(dirname $0)`
flake8 .
pydocstyle .
ANSIBLE_LIBRARY=${ANSIBLE_LIBRARY:-"${topdir}/plugins/modules"}
ANSIBLE_MODULE_UTILS=${ANSIBLE_MODULE_UTILS:-"${topdir}/plugins/module_utils"}
export ANSIBLE_LIBRARY ANSIBLE_MODULE_UTILS
yaml_dirs=(
"${topdir}/tests/*.yml"
"${topdir}/tests/*/*.yml"
"${topdir}/tests/*/*/*.yml"
"${topdir}/playbooks/*.yml"
"${topdir}/playbooks/*/*.yml"
"${topdir}/molecule/*/*.yml"
"${topdir}/molecule/*/*/*.yml"
)
ansible-lint --force-color ${yaml_dirs[@]}
yamllint -f colored ${yaml_dirs[@]}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment