master
md 999 Bytes

Handle Malformed Local Codacy JSON

Use this when analyze-local.sh writes a local-*.json file but jq cannot parse it.

  1. Verify the dump before reading it as findings:
   jq empty .local/audits/codacy/local-*.json
  1. If parsing fails, inspect the first lines:
   sed -n '1,80p' .local/audits/codacy/local-*.json
  1. Treat tool-runner logs as a local-analysis failure, not as Codacy findings. A known failure mode is a Dockerized tool trying to read /.codacyrc as a file and reporting read /.codacyrc: is a directory.

  2. Check GitHub check-run annotations:

   gh api repos/netdata/netdata/check-runs/<CHECK_RUN_ID>/annotations --paginate
  1. If annotations are empty, fetch PR issues through the Codacy API:
   .agents/skills/codacy-audit/scripts/pr-issues.sh <PR_NUMBER>
  1. If CODACY_TOKEN is not configured, record that Codacy details are not locally available and re-check after the next push.