From 73c06b8b258f3a62fb411dce4de01221a98bc37d Mon Sep 17 00:00:00 2001 From: Bryan Quigley Date: Tue, 28 Jan 2025 23:39:54 -0800 Subject: [PATCH] Finish up CI improvements this includes spellcheck for both other files and markdown updated lint script that has more options - including formatting enabled markdown link checker as the first pass on making sure links work update CI to only activate on changed files --- .github/workflows/ci.yml | 2 +- .mega-linter.yml | 2 ++ cspell.json | 3 ++- scripts/lint | 34 +++++++++++++++++----------------- 4 files changed, 22 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ed867365..a17f0cc8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,6 @@ jobs: steps: - uses: actions/checkout@v4 - name: MegaLinter - run: ./scripts/lint + run: ./scripts/lint -c env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.mega-linter.yml b/.mega-linter.yml index bd4f26f97..207349f6b 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -12,8 +12,10 @@ DISABLE_LINTERS: - YAML_V8R - SPELL_LYCHEE - MARKDOWN_MARKDOWNLINT + - MARKDOWN_MARKDOWN_TABLE_FORMATTER PRINT_ALL_FILES: false DOCKERFILE_HADOLINT_ARGUMENTS: "--ignore DL3008 --ignore DL4006 --ignore DL3009 --ignore DL3059" +BASH_SHFMT_ARGUMENTS: "-i 4" SHOW_ELAPSED_TIME: true FLAVOR_SUGGESTIONS: true EMAIL_REPORTER: false diff --git a/cspell.json b/cspell.json index 9eb0839e3..b8f3e4ea2 100644 --- a/cspell.json +++ b/cspell.json @@ -18,6 +18,7 @@ "Phila", "ublabs", "customised", - "customise" + "customise", + "shfmt" ] } diff --git a/scripts/lint b/scripts/lint index 849f9d674..74cc77666 100755 --- a/scripts/lint +++ b/scripts/lint @@ -6,23 +6,23 @@ APPLY_FIXES=none VALIDATE_ALL_CODEBASE=true while [[ $# -gt 0 ]]; do - case "$1" in - -f | --fix) - APPLY_FIXES=true - ;; - -c | --changes-only) - VALIDATE_ALL_CODEBASE=false - ;; - *) - echo "Unknown option: $1" - echo "$USAGE" - exit 1 - ;; - esac - shift + case "$1" in + -f | --fix) + APPLY_FIXES=all + ;; + -c | --changes-only) + VALIDATE_ALL_CODEBASE=false + ;; + *) + echo "Unknown option: $1" + echo "$USAGE" + exit 1 + ;; + esac + shift done docker run --rm \ - -e APPLY_FIXES=$APPLY_FIXES \ - -e VALIDATE_ALL_CODEBASE=$VALIDATE_ALL_CODEBASE \ - -v "$PWD":/tmp/lint oxsecurity/megalinter-python + -e APPLY_FIXES=$APPLY_FIXES \ + -e VALIDATE_ALL_CODEBASE=$VALIDATE_ALL_CODEBASE \ + -v "$PWD":/tmp/lint oxsecurity/megalinter-python