chore: add shared dclint configuration

This commit is contained in:
lingkai5wu committed 2026-08-15 21:45:08 +08:00
1 parent 21721df7f5
commit 6da8327572
2 files changed
+33 -12

No files matched your search

+11
View File
@@ -0,0 +1,11 @@
{
"rules": {
"require-quotes-in-ports": [
1,
{
"quoteType": "double"
}
],
"services-alphabetical-order": 0
}
}
+22 -12
View File
@@ -1,16 +1,26 @@
#!/usr/bin/env bash
set -euo pipefail
STACKS_DIR="/srv/stacks"
args=(
--rm
-t
-v "$STACKS_DIR:/app"
zavoloklom/dclint
.
-r
--disable-rule services-alphabetical-order
)
if [[ "${1:-}" == "--fix" ]]; then
args+=(--fix)
docker_args=(--rm -v "$STACKS_DIR:/app")
dclint_args=(. -r)
if [[ -t 1 ]]; then
docker_args+=(-t)
fi
docker run "${args[@]}"
case "${1:-}" in
"")
;;
--fix)
dclint_args+=(--fix)
;;
*)
printf 'Usage: %s [--fix]\n' "${0##*/}" >&2
exit 2
;;
esac
exec docker run "${docker_args[@]}" \
zavoloklom/dclint \
"${dclint_args[@]}"