build: add linter options.

This commit is contained in:
Alexandre Pujol 2023-09-19 18:35:24 +01:00
parent 24affe46f2
commit a53f10e431
No known key found for this signature in database
GPG Key ID: C5469996F0DF68EC
3 changed files with 17 additions and 6 deletions

View File

@ -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

View File

@ -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

View File

@ -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/