Skip to content

Commit

Permalink
oscal
Browse files Browse the repository at this point in the history
  • Loading branch information
Racer159 committed Oct 3, 2024
1 parent 28e0b95 commit 8543a79
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
- name: Lint the repository
run: |
uds run lint:all --no-progress --set OSCALFILES=./oscal-component.yaml
uds run lint:all --no-progress
15 changes: 12 additions & 3 deletions tasks/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
variables:
- name: OSCALFILES
default: ./oscal.yaml
default: ./oscal-component.yaml

tasks:
- name: deps
Expand All @@ -27,7 +27,16 @@ tasks:
description: Run linting checks on OSCAL
actions:
- description: Lint OSCAL files
cmd: lula tools lint -f "$OSCALFILES"
cmd: |
for file in $OSCALFILES; do
if [ ! -f "$file" ]; then
echo "⚠️ WARNING: file $file does not exist."
exit 0
fi
done
# shellcheck disable=SC2086
lula tools lint -f $OSCALFILES
- name: shell
description: Run shellcheck on all Maru tasks, GitHub workflows, and local shell scripts
Expand All @@ -39,7 +48,7 @@ tasks:
cmd: |
# These settings:
# -x Assume files exist (since some scripts run on VMs)
# -e SC2016 Ignore unexpanded env vars (since sometimes we want to dynamically add something to something like .bashrc)
# -e SC2016 Ignore unexpanded env vars (since sometimes we want to dynamically add a var to something like .bashrc)
# -e SC2050 Ignore if statements that are static (inputs / expressions are filtered for shellcheck to work which in some expressions makes them static)
# -e SC2001 Ignore sed replace suggestions (${text//search/replacement} syntax doesn't support regex so this suggestion often won't work)
# -e SC2002 Ignore rejection of `cat |` (redirection syntax is not always familiar to developers and while cat _could_ not exist that is extremely unlikely)
Expand Down

0 comments on commit 8543a79

Please sign in to comment.