Module ignore

Module ignore 

Source
Expand description

Ignore comment support for nginx-lint

This module provides support for inline ignore comments that ignore lint errors on specific lines.

§Comment Formats

§Comment-only line (targets next line)

# nginx-lint:ignore rule-name reason
server_tokens on;

§Inline comment (targets current line)

server_tokens on; # nginx-lint:ignore rule-name reason
  • rule-name: Required. The name of the rule to ignore
  • reason: Required. A reason explaining why the rule is ignored

Structs§

FilterResult
Result of filtering errors with ignore tracker
IgnoreTracker
Tracks ignored rules per line
IgnoreWarning
A warning generated from parsing ignore comments

Functions§

filter_errors
Filter errors using an ignore tracker, returning remaining errors and ignored count
parse_context_comment
Parse context comment from file content
warnings_to_errors
Convert ignore warnings to lint errors