Skip to content

Commit

Permalink
Configure super-linter for shfmt tool
Browse files Browse the repository at this point in the history
  • Loading branch information
electrocucaracha committed Jun 21, 2024
1 parent 7e815bf commit 72c168d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[*.sh]
indent_style = space
indent_size = 4

[playbooks/roles/pmem/files/**]
ignore = true

[spec/**]
ignore = true
1 change: 1 addition & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
LINTER_RULES_PATH: /
VALIDATE_KUBERNETES_KUBEVAL: false
VALIDATE_NATURAL_LANGUAGE: false
EDITORCONFIG_FILE_NAME: .editorconfig
KUBERNETES_KUBECONFORM_OPTIONS: '-ignore-missing-schemas -ignore-filename-pattern custom-rules.yml'
check-tox:
name: Check syntax (tox)
Expand Down
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ lint:
-e LINTER_RULES_PATH=/ \
-e VALIDATE_KUBERNETES_KUBEVAL=false \
-e VALIDATE_NATURAL_LANGUAGE=false \
-e EDITORCONFIG_FILE_NAME=.editorconfig \
-e KUBERNETES_KUBECONFORM_OPTIONS='-ignore-missing-schemas -ignore-filename-pattern custom-rules.yml' \
github/super-linter
tox -e lint

.PHONY: fmt
fmt:
sudo -E $(DOCKER_CMD) run --rm -u "$$(id -u):$$(id -g)" \
-v "$$(pwd):/mnt" -v /mnt/spec -v /mnt/playbooks/roles/pmem/files/ \
-w /mnt mvdan/shfmt -l -w -i 4 -s .
command -v shfmt > /dev/null || curl -s "https://i.jpillora.com/mvdan/sh!!?as=shfmt" | bash
shfmt -l -w -s .
command -v yamlfmt > /dev/null || curl -s "https://i.jpillora.com/google/yamlfmt!!" | bash
yamlfmt -dstar **/*.{yaml,yml}

0 comments on commit 72c168d

Please sign in to comment.