Skip to content

Commit

Permalink
Move lint steps to lint script
Browse files Browse the repository at this point in the history
  • Loading branch information
deniscostadsc committed Oct 1, 2023
1 parent 53c532f commit 5b77fad
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ run:
provisioning.yml -i hosts

lint:
@./scripts/run-tests.sh
@docker build -q -f .docker/lint-ansible.Dockerfile -t lint-ansible .
@docker run -v $$(pwd):/code lint-ansible
@docker build -q -f .docker/lint-sh.Dockerfile -t lint-sh .
Expand Down
14 changes: 14 additions & 0 deletions scripts/lint-sh.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ set -euo pipefail
SH_SCRIPTS="$(find . -name '*.sh' -o -name '.bashrc' -o -name '.bash_profile')"
EXIT_STATUS=0

shopt -s globstar nullglob

for file in **/*.yaml; do
echo "The file ${file} should have .yml as extension"
EXIT_STATUS=1
done

for file in **/*.yml; do
if ! grep '^\-\-\-$' "${file}" &> /dev/null; then
echo "The file ${file} does not has a '---' at the beggining."
EXIT_STATUS=1
fi
done

for script in ${SH_SCRIPTS}; do
shellcheck "${script}" && continue
EXIT_STATUS=1
Expand Down
21 changes: 0 additions & 21 deletions scripts/run-tests.sh

This file was deleted.

0 comments on commit 5b77fad

Please sign in to comment.