.agents/skills/codacy-audit/how-tos/reproduce-pr-22423-markdownlint.md
You want to confirm analyze-local.sh matches what Codacy CI reported on a known fixture. PR #22423 is the canonical fixture for this skill: its first CI run reported 864 markdownlint findings; commit 3a54c9afbc cleared them by adding .agents/** and docs/netdata-ai/skills/** to .codacy.yml.
This how-to walks through reproducing those 864 findings on the pre-exclusion state, then confirming the post-exclusion state shows zero on the affected files.
docker available (or codacy-analysis-cli installed locally).<repo>/.env need NOT contain CODACY_TOKEN -- analyze-local.sh runs the CLI anonymously.PR #22423 introduced the exclusion in commit 3a54c9afbc. The parent commit d7791e6838 is the "before" state.
git checkout d7791e6838 -- .codacy.yml # restore the pre-exclusion .codacy.yml
# (do NOT switch branches; just stage the older .codacy.yml)
.agents/skills/codacy-audit/scripts/analyze-local.sh --tool markdownlint
Expected: a JSON dump under <repo>/.local/audits/codacy/local-markdownlint-<ts>.json. The CLI returns non-zero when findings exist (this is normal; the script tolerates it).
DUMP="$(ls -1t .local/audits/codacy/local-markdownlint-*.json | head -1)"
jq '
if type=="array" then length
elif type=="object" and has("issues") then (.issues | length)
elif type=="object" and has("results") then (.results | length)
else 0 end
' "$DUMP"
Expected: a count close to 864 (within ~10% tolerance for tool-version drift between the CLI bundle and Codacy Cloud).
git checkout HEAD -- .codacy.yml
.agents/skills/codacy-audit/scripts/analyze-local.sh --tool markdownlint
DUMP="$(ls -1t .local/audits/codacy/local-markdownlint-*.json | head -1)"
jq '[ ... | select(.filePath | startswith(".agents/") or startswith("docs/netdata-ai/skills/")) ] | length' "$DUMP"
(The exact jq filter depends on the dump shape -- consult the dump structure first via jq 'keys' "$DUMP".)
Expected: zero rows in the excluded trees.
analyze-local.sh runs end-to-end against the configured runner (docker or local binary)..codacy.yml exclude_paths (or, if it doesn't, we have empirical evidence to handle that gap in a GitHub issue or branch-local SOW).codacy/codacy-analysis-cli:latest is a few hundred MB. Subsequent runs use the warm cache.codacy-analysis-cli and Codacy Cloud is normal. ~10% tolerance is fine. Anything wider warrants checking the CLI version vs Cloud's reported version.