Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content-guards/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "content-guards",
"version": "1.0.0",
"version": "1.0.1",
"description": "Combined content validation and guard plugin that merges token-validator, markdown-validator, webfetch-guard, and issue-limiter functionality",
"author": {
"name": "JacobPEvans"
Expand Down
24 changes: 15 additions & 9 deletions content-guards/scripts/validate-markdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,22 @@ EOF
fi
fi

if [[ ${#config_flag[@]} -gt 0 ]]; then
if ! markdownlint_output=$(markdownlint-cli2 "${config_flag[@]}" "$file_path" 2>&1); then
errors+=("markdownlint-cli2 failed:")
errors+=("$markdownlint_output")
fi
# markdownlint-cli2 requires the target file to be within its working directory.
# Run from the config directory (when config found) or the file's own directory.
if [[ "$has_project_config" == "true" ]]; then
lint_dir="$search_dir"
else
if ! markdownlint_output=$(markdownlint-cli2 "$file_path" 2>&1); then
errors+=("markdownlint-cli2 failed:")
errors+=("$markdownlint_output")
fi
lint_dir="$(dirname -- "$file_path")"
fi
if [[ "$lint_dir" == "/" ]]; then
lint_file="${file_path#/}"
else
lint_file="${file_path#${lint_dir}/}"
fi

if ! markdownlint_output=$( { cd "$lint_dir" && markdownlint-cli2 "${config_flag[@]}" "$lint_file"; } 2>&1 ); then
errors+=("markdownlint-cli2 failed:")
errors+=("$markdownlint_output")
fi
fi

Expand Down
Loading