From a53f10e43120496cb7be0c0d31148bd41f65abdf Mon Sep 17 00:00:00 2001 From: Alexandre Pujol Date: Tue, 19 Sep 2023 18:35:24 +0100 Subject: [PATCH] build: add linter options. --- .gitlab-ci.yml | 12 +++++++++++- Makefile | 3 ++- tests/Makefile | 8 ++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 51f76b4a5..92045d1b7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,7 +23,7 @@ bash: image: koalaman/shellcheck-alpine script: - shellcheck --shell=bash - PKGBUILD dists/build.sh + PKGBUILD dists/build.sh dists/docker.sh tests/packer/init/init.sh tests/packer/src/aa-update tests/packer/init/clean.sh debian/apparmor.d.postinst debian/apparmor.d.postrm @@ -33,6 +33,16 @@ golangci-lint: script: - golangci-lint run +packer: + stage: lint + image: + name: hashicorp/packer:latest + entrypoint: [""] + script: + - cd tests && + packer fmt --check packer/ && + packer validate --syntax-only packer/ + sast: stage: lint diff --git a/Makefile b/Makefile index 3d1ec8092..c1ad96b2d 100644 --- a/Makefile +++ b/Makefile @@ -89,8 +89,9 @@ tests: lint: @golangci-lint run + @make --directory=tests lint @shellcheck --shell=bash \ - PKGBUILD dists/build.sh \ + PKGBUILD dists/build.sh dists/docker.sh \ tests/packer/init/init.sh tests/packer/src/aa-update tests/packer/init/clean.sh \ debian/${PKGNAME}.postinst debian/${PKGNAME}.postrm diff --git a/tests/Makefile b/tests/Makefile index d595eff21..cb9c4bfa8 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -18,11 +18,11 @@ BASE = archlinux debian ubuntu opensuse .PHONY: ${BASE} lint $(BASE): - make --directory=../ package dist=${@} - packer build -force -var version=${VERSION} \ + @make --directory=../ package dist=${@} + @packer build -force -var version=${VERSION} \ -var disk_size=${disk} -var flavor="${flavor}" \ -only=qemu.${@}-${flavor} packer/ lint: - @packer fmt packer/ - @packer validate packer/ + @packer fmt --check packer/ + @packer validate --syntax-only packer/