Add opt-in shell lint and format targets

Introduce make lint-shell / fmt-shell with shellcheck and
shfmt (-i 2 -ci -bn), normalize first-party scripts, and
document the new targets. Keep them out of make lint / fmt.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-07-23 15:51:43 +02:00
parent 9e9272b4ac
commit 570395c4ac
13 changed files with 856 additions and 733 deletions

View File

@@ -16,7 +16,7 @@ schema_body=$(mktemp)
trap 'rm -f "$mutation_fields" "$schema_body"' EXIT
process_file() {
awk -v mf="$mutation_fields" '
awk -v mf="$mutation_fields" '
/^type Mutation$/ { next }
/^(extend )?type Mutation \{/ { skip=1; depth=1; next }
skip {
@@ -29,16 +29,16 @@ process_file() {
}
{
process_file "$base"
for f in "$graphql_dir"/*.graphql; do
[ "$f" = "$base" ] && continue
process_file "$f"
done
} > "$schema_body"
process_file "$base"
for f in "$graphql_dir"/*.graphql; do
[ "$f" = "$base" ] && continue
process_file "$f"
done
} >"$schema_body"
{
cat "$schema_body"
printf '\ntype Mutation {\n'
cat "$mutation_fields"
printf '}\n'
} > "$output"
cat "$schema_body"
printf '\ntype Mutation {\n'
cat "$mutation_fields"
printf '}\n'
} >"$output"