chore: add shared dclint configuration
This commit is contained in:
1 parent
21721df7f5
commit
6da8327572
2 files changed
+33
-12
No files matched your search
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"rules": {
|
||||||
|
"require-quotes-in-ports": [
|
||||||
|
1,
|
||||||
|
{
|
||||||
|
"quoteType": "double"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"services-alphabetical-order": 0
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +1,26 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
STACKS_DIR="/srv/stacks"
|
STACKS_DIR="/srv/stacks"
|
||||||
args=(
|
docker_args=(--rm -v "$STACKS_DIR:/app")
|
||||||
--rm
|
dclint_args=(. -r)
|
||||||
-t
|
|
||||||
-v "$STACKS_DIR:/app"
|
if [[ -t 1 ]]; then
|
||||||
zavoloklom/dclint
|
docker_args+=(-t)
|
||||||
.
|
|
||||||
-r
|
|
||||||
--disable-rule services-alphabetical-order
|
|
||||||
)
|
|
||||||
if [[ "${1:-}" == "--fix" ]]; then
|
|
||||||
args+=(--fix)
|
|
||||||
fi
|
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[@]}"
|
||||||
Reference in new issue
Block a user