From 8467bfbc42bf86104b94839ae4556b3ff8b39685 Mon Sep 17 00:00:00 2001 From: Victor Morales Date: Mon, 30 Sep 2024 10:23:57 -0700 Subject: [PATCH] Use editorconfig file --- .editorconfig | 6 ++++++ .github/workflows/linter.yml | 1 + Makefile | 5 +++-- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..a44b52982 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,6 @@ +[*.sh] +indent_style = space +indent_size = 4 + +[spec/**] +ignore = true diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index 8e994bccd..94d03e9d6 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -43,6 +43,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} LINTER_RULES_PATH: / + EDITORCONFIG_FILE_NAME: .editorconfig FILTER_REGEX_EXCLUDE: "requirements/.*" check-tox: name: Check syntax (tox) diff --git a/Makefile b/Makefile index 89a26449d..6f31b351a 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,14 @@ lint: -e RUN_LOCAL=true \ -e LINTER_RULES_PATH=/ \ -e FILTER_REGEX_EXCLUDE="requirements/.*" \ + -e EDITORCONFIG_FILE_NAME=.editorconfig \ 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 -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} command -v prettier > /dev/null || npm install prettier