Skip to content

Commit 4628033

Browse files
committed
More fixes
1 parent 3131cab commit 4628033

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

.github/actions/detect-relevant-changes/action.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ runs:
5454
DEFAULT_TYPE_PATTERNS[cmake]=$'CMakeLists.txt\n*.cmake'
5555
DEFAULT_TYPE_PATTERNS[python]=$'*.py'
5656
DEFAULT_TYPE_PATTERNS[jsonnet]=$'*.jsonnet\n*.libsonnet'
57-
57+
declare -A NON_GENERATED_TYPES
58+
NON_GENERATED_TYPES[jsonnet]="1"
59+
5860
parse_list() {
5961
local input="$1"
6062
printf '%s' "$input" | tr ',' '\n' | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' -e '/^$/d'
@@ -126,6 +128,9 @@ runs:
126128
}
127129
128130
for type in "${REQUESTED_TYPES[@]}"; do
131+
if [ -n "${NON_GENERATED_TYPES[$type]}" ]; then
132+
continue
133+
fi
129134
patterns=${TYPE_PATTERNS[$type]:-}
130135
if [ -z "$patterns" ]; then
131136
echo "::warning::No patterns defined for type '$type'"

.github/workflows/jsonnet-format-check.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ jobs:
101101
id: lint
102102
working-directory: ${{ env.local_checkout_path }}
103103
run: |
104-
find . \( -name "*.jsonnet" -o -name "*.jsonnet.in" -o -name "*.libsonnet" -o -name "*.libsonnet.in" \) -exec jsonnetfmt --test {} \;
104+
find . \( -name "*.jsonnet" -o -name "*.libsonnet" \) -print0 | xargs -0 -r -I {} \
105+
bash -c 'jsonnetfmt --test "{}" || (echo "FAILED: {}" && diff -u <(jsonnetfmt "{}") "{}" && exit 1)'
105106
continue-on-error: true
106107

107108
- name: Evaluate jsonnetfmt result

.github/workflows/jsonnet-format-fix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ jobs:
8181
id: lint
8282
working-directory: ${{ env.local_checkout_path }}
8383
run: |
84-
find . \( -name "*.jsonnet" -o -name "*.jsonnet.in" -o -name "*.libsonnet" -o -name "*.libsonnet.in" \) -exec jsonnetfmt -i {} \;
84+
find . \( -name "*.jsonnet" -o -name "*.libsonnet" \) -print0 | xargs -0 -r jsonnetfmt -i
8585
continue-on-error: true
8686

8787
- name: Handle fix commit

0 commit comments

Comments
 (0)