Skip to content

Commit

Permalink
Finish up CI improvements
Browse files Browse the repository at this point in the history
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
  • Loading branch information
BryanQuigley committed Feb 4, 2025
1 parent d1f826f commit 73c06b8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
2 changes: 2 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"Phila",
"ublabs",
"customised",
"customise"
"customise",
"shfmt"
]
}
34 changes: 17 additions & 17 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 73c06b8

Please sign in to comment.