class

Flaw::Suppression

Inherits Reference < Object

Parses inline suppression directives in a Crystal source file.

foo(user_input) # flaw:ignore FLAW001 # flaw:ignore-next FLAW001,FLAW006 bar(x)

File-level directive on any line (canonically the first): # flaw:ignore-file FLAW002

Special ID ALL suppresses every rule.

Constants

FILE_WIDE = /#\s*flaw:ignore-file\s+([A-Z0-9_,\s]+)/
NEXT_LINE = /#\s*flaw:ignore-next(?:-line)?\s+([A-Z0-9_,\s]+)/
SAME_LINE = /#\s*flaw:ignore\s+([A-Z0-9_,\s]+)/

Constructors

new(line_suppressed : Hash(Int32, Set(String)) = {} of Int32 => Set(String), file_suppressed : Set(String) = Set(String).new)
Source
parse(source : String) : Suppression
Source

Instance methods

file_suppressed
Source
line_suppressed
Source
suppressed?(rule_id : String, line : Int32) : Bool
Source