From 66345d0ab73f4f52e6d4ce51afc13ccf9593d79d Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 16 Sep 2022 07:09:12 +1000 Subject: [PATCH] linters: lint that library files don't start with #! See notes in I4e6e85156459cca032e6c3e1d8a9284be919ccca, this ensures the library files don't start with #! so they will run under the Ansible interpeter on the remote node. Change-Id: I8754d0962e8453d2030c589be23560e454e0052e --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 8907118bc..3765b3195 100644 --- a/tox.ini +++ b/tox.ini @@ -46,6 +46,7 @@ deps = -r{toxinidir}/linters-requirements.txt commands = + bash -c "for f in $(find . -path './roles/*/library/*.py' | xargs); do echo Checking shebang on $f; if head -1 $f | grep -q '^#!'; then echo $f 'starts with #!, it should not as Ansible will choose the interpreter'; exit 1; fi; done" flake8 {posargs} yamllint -s -f parsable . python -m ansiblelint --version