mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-02 05:44:03 +02:00
Remove JSON sorting from lint workflow
Removed JSON sorting steps from the lint workflow.
This commit is contained in:
26
.github/workflows/lint.yml
vendored
26
.github/workflows/lint.yml
vendored
@@ -73,21 +73,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
find . -type f \( -name "*.sh" -o -name "run" \) -exec chmod +x {} \;
|
find . -type f \( -name "*.sh" -o -name "run" \) -exec chmod +x {} \;
|
||||||
|
|
||||||
- name: Sort changed JSON files
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
mapfile -t changed < <(git diff --name-only "$DIFF_RANGE" -- '*/*.json')
|
|
||||||
if [ "${#changed[@]}" -eq 0 ]; then
|
|
||||||
echo "No changed JSON files to sort."
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
for file in "${changed[@]}"; do
|
|
||||||
if [ -f "$file" ]; then
|
|
||||||
tmp="$file.tmp"
|
|
||||||
jq --sort-keys . "$file" > "$tmp" && mv "$tmp" "$file"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Remove Super-Linter output (prevent checkout conflict)
|
- name: Remove Super-Linter output (prevent checkout conflict)
|
||||||
run: sudo rm -rf super-linter-output/
|
run: sudo rm -rf super-linter-output/
|
||||||
|
|
||||||
@@ -130,7 +115,7 @@ jobs:
|
|||||||
FIX_JSON: false
|
FIX_JSON: false
|
||||||
FIX_MARKDOWN: true
|
FIX_MARKDOWN: true
|
||||||
FIX_PYTHON_BLACK: true
|
FIX_PYTHON_BLACK: true
|
||||||
FIX_PYTHON_ISORT: true
|
FIX_PYTHON_ISORT: false
|
||||||
FIX_PYTHON_RUFF: true
|
FIX_PYTHON_RUFF: true
|
||||||
|
|
||||||
- name: Use 4 spaces in shell scripts
|
- name: Use 4 spaces in shell scripts
|
||||||
@@ -139,15 +124,6 @@ jobs:
|
|||||||
chmod +x /usr/local/bin/shfmt
|
chmod +x /usr/local/bin/shfmt
|
||||||
find . -type f \( -name "*.sh" -o -name "run" \) -exec shfmt -w -i 4 -ci -bn -sr {} +
|
find . -type f \( -name "*.sh" -o -name "run" \) -exec shfmt -w -i 4 -ci -bn -sr {} +
|
||||||
|
|
||||||
- name: Sort json files
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
shopt -s nullglob
|
|
||||||
for file in */*.json; do
|
|
||||||
tmp="$file.tmp"
|
|
||||||
jq --sort-keys . "$file" > "$tmp" && mv "$tmp" "$file"
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Restore executable permissions
|
- name: Restore executable permissions
|
||||||
run: |
|
run: |
|
||||||
find . -type f \( -name "*.sh" -o -name "run" \) -exec chmod +x {} \;
|
find . -type f \( -name "*.sh" -o -name "run" \) -exec chmod +x {} \;
|
||||||
|
|||||||
Reference in New Issue
Block a user