-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlint.sh
More file actions
executable file
·32 lines (27 loc) · 810 Bytes
/
lint.sh
File metadata and controls
executable file
·32 lines (27 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
set -eu
# Lint all SKILL.md files using nori-lint.
# Works locally and in CI.
#
# Set ANTHROPIC_API_KEY to enable LLM rules.
# Without it, only static rules run.
# Source .env.local if present (local API key)
if [ -f ".env.local" ]; then
set -a
. ./.env.local
set +a
fi
LINT_DIR="${1:-skills}"
TMP_CONFIG=""
CONFIG_FLAG=""
if [ -n "${ANTHROPIC_API_KEY:-}" ]; then
TMP_CONFIG="$(mktemp "${TMPDIR:-/tmp}/nori-lint-config.XXXXXX")"
trap 'rm -f "$TMP_CONFIG"' EXIT INT TERM
printf '{"anthropic_api_key":"%s","rules":{"disabled":["first_person","unexplained_url"]}}\n' "$ANTHROPIC_API_KEY" > "$TMP_CONFIG"
CONFIG_FLAG="--config $TMP_CONFIG"
fi
if command -v nori-lint >/dev/null 2>&1; then
nori-lint lint "$LINT_DIR" $CONFIG_FLAG
else
npx nori-lint lint "$LINT_DIR" $CONFIG_FLAG
fi