Skip to content
Back to skills

Audit Suppressions

ASecurity

List lint/type/coverage/security suppression diff/tree: eslint-disable/@ts-expect-error/noqa/type: ignore/pylint/pyright/SuppressMessage/@SuppressWarnings/pragma/shellcheck/nolint/markdownlint/rubocop/istanbul/c8/coverage.py/Stryker/bandit/nosec/nosemgrep/gitleaks; rule/reason/justified/correctness, no gate. Use when 'which noqa have no reason', 'suppressions added in this change'. Not for size: /code-metrics:audit.

  • 34 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 8, 2026
ai-agentstypescriptpythongojavaswiftc#shellbashtestinggit

Works with

  • cli
  • api

Security analysis

A100/100

Pro scans all 5 files and shows the line behind each finding

Scanned December 3, 2026

npx -y skills add melodic-software/claude-code-plugins --skill audit-suppressions --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Audit Suppressions?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Audit Suppressions
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/melodic-software-audit-suppressions/badge)](https://www.skillsdirectory.com/skills/melodic-software-audit-suppressions)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
# portability-ok: R6 kept-adapter operation - audit-suppressions.sh C# patterns
description: "List lint/type/coverage/security suppression diff/tree: eslint-disable/@ts-expect-error/noqa/type: ignore/pylint/pyright/SuppressMessage/@SuppressWarnings/pragma/shellcheck/nolint/markdownlint/rubocop/istanbul/c8/coverage.py/Stryker/bandit/nosec/nosemgrep/gitleaks; rule/reason/justified/correctness, no gate. Use when 'which noqa have no reason', 'suppressions added in this change'. Not for size: /code-metrics:audit."
argument-hint: "[--json|--findings [--memory-dir <dir>]] [--all] [--base <ref>] [<path>...] [--repo <repo> ...]"
user-invocable: true
disable-model-invocation: false
allowed-tools: ["Bash(${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh:*)", "Bash(python3 ${CLAUDE_SKILL_DIR}/scripts/suppression-scan.py:*)", "Bash(git branch --show-current:*)"]
shell: bash
metadata:
  workflow-stage: anytime
  summary: Suppressions with their rule ids and reasons, no verdict
---

# Audit suppressions

## Pre-computed context

Current branch: !`git branch --show-current 2>/dev/null || echo "unknown"`

## Purpose

A suppression turns a linter or type checker off for one line, one block or one file. Three further
classes switch off the evidence a quality bar rests on, and the scanner lists them the same way:
coverage exclusions (istanbul, c8 and coverage.py), mutation-testing exclusions (Stryker) and
security-scanner suppressions (Bandit, Semgrep and Gitleaks). This skill lists all of them so a reader can see how many there are, which explain themselves, and which switch off
a rule the team counts as correctness rather than style.
It reports and stops: no pass or fail, and the report carries no severity (a `--findings` file
carries the tier its rule's row sets, below). Whether a suppression should go is the reader's call.

A suppression is **justified** when it carries a reason and, for a tool whose syntax can name
a rule, at least one rule id. TypeScript's `@ts-ignore`, `@ts-expect-error` and `@ts-nocheck`
cannot name an error, so a reason alone justifies them. Where a tool has a reason slot of its own,
the text there is the reason (ESLint and RuboCop after `--`, a `Justification` argument in C# and <!-- portability-ok: R6 kept-adapter operation - audit-suppressions.sh C# patterns -->
PowerShell); otherwise a further comment on the same line is (a TypeScript directive's trailing
text, a second `<!-- -->` after a markdownlint directive, a `//` comment after `@SuppressWarnings`,
a second `#` comment after a Python or shell pragma). A directive with no reason on its line (a
comment directive, a `#pragma warning disable`, or a `[SuppressMessage]` or `@SuppressWarnings`
attribute) takes the comment lines directly above
it as its reason, as `# jq filters are literal text.` does for a `# shellcheck disable=SC2016` on
the next line. A blank line, a code line, another directive,
a shebang or another tool's instruction (`# shellcheck source=...`) between them breaks that link.
So does a C# or Java documentation comment (`///`, or a `/** ... */` block): it documents the <!-- portability-ok: R6 kept-adapter operation - suppression-scan.py C# and Java doc-comment rule -->
member, not the suppression, so it is never a reason.

Only real comments, pragmas and attributes count. A marker inside a string literal, a Markdown code
span or a fenced code block in a Markdown file is not a suppression.

## Run it

```bash
"${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh"                    # lines the commits since the merge-base add
"${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh" --base release/2.0  # the merge-base with another branch
"${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh" --all              # every suppression in the tree
"${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh" src/ tools/build.sh # explicit paths, whole files
"${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh" --json --all        # the document instead of markdown
"${CLAUDE_SKILL_DIR}/scripts/audit-suppressions.sh" --findings          # the report plus a findings file for /review:fanout fix
```

Append `--user-file '${user_config.config_file}'` to every script call, exactly as written:
it names the file holding your userConfig layer, and an empty or unsubstituted value means none
(`${CLAUDE_PLUGIN_ROOT}/reference/config.md`).

The change scope reads committed lines only: a suppression in an uncommitted edit is not in it until
it is committed, so name the file or use `--all` to see the working tree. `scope.exclude` and language
opt-outs apply as in the other audits.

A target form (`--repo <repo>` and the others) runs the script once per repository, as
`${CLAUDE_PLUGIN_ROOT}/reference/several-repositories.md` says, and never passes the form to the
script. Each repository's `suppressions.correctness_rules` marks its own rows, and a `--findings`
run writes one findings file per repository, under that repository's memory root and branch; a
`--memory-dir` given with a target form must be relative, and is read from each root.

Present the markdown report as printed, whole, with your notes after it: the scope, the counts, the correctness list with the layer
that set it, then one row per suppression (correctness rules first, then lines without a reason),
capped at 200 rows with the kept document named for the rest, then a `Not read` line naming each
text file in scope whose language the scanner has no kind for. The `--json` document
(`code-metrics/suppressions/v1`) carries `scope`, `counts` (`suppressions`, `unjustified`,
`correctness`), `correctness_rules` (`rules`, `layer`), `suppressions`, one object per row with
`file`, `line`, `tool`, `rules`, `justified`, `reason` and `correctness`, and `unread`, the paths of
those files.

## Findings for the review relay (`--findings`)

`--findings` runs the same scan in the same scope, prints the same report, then writes one findings
file in the shape `/review:fanout fix` (if enabled) reads and prints its path. It asks nothing, so a pipeline or
another skill can run it. Bare invocation and `--json` write no findings file.

- **Where it goes.** `<memory root>/reviews/<branch-slug>/<UTC stamp>-suppressions.md`, the
  directory `/review:fanout` (if enabled) "Shared inputs" names. The memory root is `.work` under the repository
  root; when the project's instructions name another memory root, pass it with `--memory-dir`. A
  memory root with no `.gitignore` gets one holding `*`, and the run says so. An existing file is
  never overwritten: a second run in the same second takes a `-2` suffix.
- **No branch, no file.** On a detached HEAD or outside a git repository the run stops with exit 2
  before scanning and says no findings file was written: the relay reads only a file whose
  `branch:` matches the current branch.
- **What becomes a row.** A justified suppression is no finding. An unjustified one is a row under
  one of two rules: `code-metrics/audit-suppressions/rule-no-reason` when the line carries no
  reason, and `code-metrics/audit-suppressions/rule-no-rule-id` when it carries a reason but no rule
  id and the tool can name one. Each `Finding` cell leads with the rule id and what fired (the tool,
  its rule ids, and the missing part); `Location` is the repo-relative `file:line`. `Tier`
  (`IMPORTANT`), `Confidence` (`high`) and the fact that neither rule is auto-applicable come from
  the two rules' rows in the detector-findings convention
  (<https://raw.githubusercontent.com/melodic-software/claude-code-plugins/main/docs/contracts/detector-findings/README.md>,
  "The severity crosswalk"), never from the finding. The `Action` names where this tool keeps its
  reason, and asks for a rule id only where the tool can name one and the line names none.
- **Coverage.** `## Surfaces` names the scope and how many suppressions were examined, and counts
  each rule's declined candidates by the evidence that declined them: a reason on the line, a rule
  id on the line, or a TypeScript directive, which cannot name an error. A run whose scope holds no
  file writes no findings file.

Whether a suppression goes or gets its reason is a human's call, so no row is auto-applicable: the
fix pass surfaces the rows rather than applying them.

## Correctness rules

`suppressions.correctness_rules` lists the rule ids whose suppression the team wants to see first.
The plugin ships the list empty, because which rules guard correctness is the repository's call.
Set it in `docs/conventions/code-metrics.yaml` as a list of the repository's own rule ids (keys in
`${CLAUDE_PLUGIN_ROOT}/reference/config.md`).

A row is marked when one of its rule ids is listed, compared case-insensitively. A suppression that
names no rule is not matched; for a tool that can name one, it is already unjustified. An invalid
value (a scalar, a number in the list) is named with its file and key, and the key falls back to a
valid higher layer or the empty default; the run continues.

## Freezing the count

The scanner behind this skill, `scripts/suppression-scan.py`, prints the count on its own:

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/suppression-scan.py" --count
# suppressions=<n>
# unjustified=<n>
```

`/toolchain:ratchet` (if enabled) can hold that count as a CI ceiling: it
vendors a copy of the scanner into the repository and ratchets the `suppressions` or `unjustified`
field. Without it, keep the `--json` document and compare counts by hand.

When you report the count, quote both lines as printed and the exact command that printed them,
so the user can run it again as the counter.

The scanner reads no configuration: with no path it scans every tracked and untracked,
not-ignored file in the repository, and `suppressions.correctness_rules` marks nothing. The caller
passes the audit's resolved scope, so the frozen count and the report count the same files: name
the paths to count and give each `scope.exclude` glob with `--exclude <glob>` (repeatable), or
list the globs one per line in a file for `--exclude-from <file>`:

```bash
python3 "${CLAUDE_SKILL_DIR}/scripts/suppression-scan.py" --count \
  --exclude 'vendor/' --exclude '**/generated/**' src/ tools/
```

A glob matches the repository-relative path in the same gitignore dialect `scope.exclude` uses. With
no `--exclude` the count is unchanged and includes any path `scope.exclude` would drop.

## Upstream syntax

The marker catalog follows each tool's own directive syntax, read from these pages:

- **Pointer:** [ESLint, disabling rules](https://eslint.org/docs/latest/use/configure/rules#disable-rules);
  [TypeScript 3.9, `@ts-expect-error`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html);
  [flake8, in-line ignoring](https://flake8.pycqa.org/en/latest/user/violations.html);
  [Ruff, error suppression](https://docs.astral.sh/ruff/linter/#error-suppression);
  [mypy, silencing the checker](https://mypy.readthedocs.io/en/stable/common_issues.html);
  [pylint, message control](https://pylint.readthedocs.io/en/stable/user_guide/messages/message_control.html);
  [Pyright, comments](https://github.com/microsoft/pyright/blob/main/docs/comments.md);
  [ShellCheck, directives](https://www.shellcheck.net/wiki/Directive);
  [C# `#pragma warning`](https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/preprocessor-directives); <!-- portability-ok: R6 kept-adapter operation - audit-suppressions.sh C# patterns -->
  [.NET, suppressing code analysis warnings](https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/suppress-warnings); <!-- portability-ok: R6 kept-adapter operation - audit-suppressions.sh C# patterns -->
  [golangci-lint, false positives](https://golangci-lint.run/docs/linters/false-positives/);
  [PSScriptAnalyzer, suppressing rules](https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/using-scriptanalyzer);
  [markdownlint, configuration](https://github.com/DavidAnson/markdownlint#configuration);
  [RuboCop, source code directives](https://docs.rubocop.org/rubocop/latest/usage/source_code_directives.html);
  [Java `SuppressWarnings`](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/SuppressWarnings.html);
  [istanbul, ignoring code for coverage](https://github.com/istanbuljs/nyc#parsing-hints-ignoring-lines);
  [c8, ignoring lines](https://github.com/bcoe/c8#ignoring-uncovered-lines-functions-and-blocks);
  [coverage.py, excluding code](https://coverage.readthedocs.io/en/latest/excluding.html);
  [Stryker, disable mutants](https://stryker-mutator.io/docs/stryker-js/disable-mutants/);
  [Bandit, suppressing individual lines](https://bandit.readthedocs.io/en/latest/config.html#suppressing-individual-lines);
  [Semgrep, ignore code through `nosemgrep`](https://docs.semgrep.dev/ignoring-files-folders-code);
  [Gitleaks, inline allow](https://github.com/gitleaks/gitleaks#gitleaksallow).
- **As of:** 2026-11-03.
- **Recheck trigger:** a tool on the list adds a suppression form, a reason syntax, or a way to name
  a rule; or a team reports a real suppression the report missed.

## What this skill does not do

- It does not remove, rewrite or approve a suppression, and it runs no linter.
- It is not the finding-suppression record in `docs/contracts/finding-suppression/`, which holds
  review findings a team chose to dismiss; this skill reads source comments and attributes.
- It does not judge: no count here is a bar. `/code-metrics:principles` explains what each number
  in this plugin can and cannot tell you.

## Next

- Hold the count in CI so it only falls: /toolchain:ratchet.
- Work through the rows a `--findings` run wrote: /review:fanout fix.
- A count needs reading before anyone acts on it: /code-metrics:principles.

## Gotchas

- The change scope needs a merge-base with the default branch; outside a git repository, or with no
  default-branch ancestor, pass paths or `--all` (the usage error says which).
- A multi-line C#, PowerShell or Java attribute is read up to ten lines past its opening line; a <!-- portability-ok: R6 kept-adapter operation - audit-suppressions.sh C# patterns -->
  longer one is reported with the rule ids and reason it showed in that span.
- A coverage, Stryker or Gitleaks directive is read only in the comment forms of the languages the
  scanner knows; a coverage exclusion kept in a tool's configuration file (a path list, an exclusion
  regex) is not reported. Bandit rule ids are read as test ids (`B` and digits); a test name after
  `nosec` reads as the reason.
- A tool not on the list (Stylelint, Clippy, SwiftLint) is not reported; nothing in the report says
  a file had none of its markers.
- The scanner needs Python 3.11 or later, above the plugin's 3.9 floor; below it the scanner
  exits 2 with a one-line message.
- File type comes from the extension, or the shebang for a file without one; a shell script named
  `*.txt` is not read as shell. A text file with no known type is named on the `Not read` line, and
  a `--findings` file counts it under `Not examined`; a binary file is passed over quietly.

Files in this skill

  • SKILL.md13 KB
  • evals/evals.json7.5 KB
  • scripts/audit-suppressions.sh16.2 KB
  • scripts/audit-suppressions.test.sh19.3 KB
  • scripts/suppression-scan.py33.4 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in ai-agents →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.