Skip to main content
Sometimes Iris Code reports something you have looked at and decided is fine, such as a test credential that is not a real secret. A suppression is a comment in your code that tells Iris Code to ignore that one finding, with a written reason. The rule stays switched on everywhere else, so other problems in the same file are still reported. Keep each suppression as narrow as you can.

Writing one

Put the comment on the line directly above the code it applies to:
Python uses #:
To cover a whole file, put iris-ignore-file anywhere in it:
The shape is the same either way:
One or more rule ids (the short names in the table below), then --, then a reason.

A reason is required

If you leave out the reason, misspell the rule id or name no rule at all, the comment suppresses nothing. Instead it is reported as a Bare Ignore, which costs points of its own.
This is deliberate. A suppression that costs nothing and explains nothing becomes a mute button rather than a decision. Months later, nobody can tell whether an any was thought through or simply inconvenient. Penalising an unexplained one keeps suppressions meaningful.

What you can suppress

Every finding that points at a specific line can be suppressed. These are the 30 code-finding rules; the nine verification integrity rules are covered further down: Findings about a whole file rather than a line cannot be suppressed: file too long, too many functions, too many imports, and parse errors (files Iris Code could not read). Those always count.

What it does to your score

A suppressed finding stops costing points, because the score is worked out after suppressions are applied. It does not disappear, though. It stays counted and listed in the sidebar and in the CLI output, so a project that keeps adding suppressions can see it happening. A bare ignore does the opposite: it suppresses nothing and takes points off, 2 by default. You can change that in Scoring Weights.

Where you see them

File tab has a collapsible Suppressed section under Code Smells, with each rule, line and reason. Bare ignores show up as their own smell row. Workspace and Folder tabs show how many suppressions and bare ignores there are, and the files with the most. See all opens the full table for the last scan, which you can filter and click to open each file. The CLI (the iris terminal commands) always prints the count. --show-suppressed lists them:
--format json includes a per-file suppressed array with the rule, line and reason.

Limiting suppressions (Pro)

Two settings in .irisconfig.json control how far suppressions can go:
The strict and security presets already set a limit (5 and 3 per file) and a heavier bare-ignore penalty (3 and 4 points). The other presets leave it unset, so there is no limit until you set one.
Commit .irisconfig.json with gateMaxSuppressions set and the limit applies to everyone. Without it, a failing file can be made to pass by suppressing findings rather than fixing anything. See Gate thresholds.

Verification integrity allowances

Verification integrity reports changes that weaken your checks, such as a deleted test. Its rule IDs are test-removed, test-disabled, assertions-weakened, checker-silenced, type-widened, error-swallowed, iris-suppressed, rules-loosened and code-packed. For these rules, the iris-ignore comment can sit at the end of the line itself or in a block comment, as well as on the line above. Text inside a string is never treated as a suppression. A suppression for an integrity finding needs a reason. The finding stays visible, marked as allowed, and the new suppression comment is itself reported as a warning. An agent should restore the check or explain a deliberate change to you, rather than quietly add a way around it. A deleted file has no line left to put a comment on. For hooks and CI, add a line to the commit message instead:
The path is relative to the repository root. Add #<test name> to limit a test allowance to one named test. code-packed applies to a whole file and does not accept the # part. Use This is intended in the editor, or Iris-Allow: code-packed src/view.ts -- reviewed compact layout for hooks and CI. A line naming an unknown rule, a path outside the repository or no reason does not allow anything. See verification integrity.