Skip to main content

Module suppression

Module suppression 

Source
Expand description

Inline suppression directive parsing.

This module provides support for inline suppression directives that allow developers to suppress specific rule matches on a line-by-line basis.

§Supported Formats

  • diffguard: ignore <rule_id> - suppresses the match on the same line
  • diffguard: ignore-next-line <rule_id> - suppresses matches on the next line
  • diffguard: ignore * or diffguard: ignore-all - suppresses all rules on the line

Multiple rules can be specified by separating with commas:

  • diffguard: ignore rule1, rule2

§Example

let x = y.unwrap(); // diffguard: ignore rust.no_unwrap
// diffguard: ignore-next-line rust.no_dbg
dbg!(value);

Structs§

EffectiveSuppressions
The effective suppressions for a single line.
Suppression
A parsed suppression directive.
SuppressionTracker
Tracks suppression state for a file being processed.

Enums§

SuppressionKind
Represents the type of suppression directive found.

Functions§

parse_suppression
Parse a line for suppression directives.
parse_suppression_in_comments
Parse a line for suppression directives, but only if the directive occurs inside a masked comment span.