Skip to Content
flowpact

FP905 · ignore-comment-unused

A `# flowpact: ignore[…]` comment names a rule that reports nothing on the line it accepts.

CodeNameCategoryDefault severityReported by
FP905ignore-comment-unusedConfig & overrides🟡 warninglint, check, the action, the editor

What you see

In the ignore-comments fixture:

▲  WARN  FP905 ignore-comment-unused
  Ignore comment for FP108 matches no finding on line 22
  ▶ .github/workflows/release.yml:22:74

Why it matters

The problem was fixed, or the comment is on another line than the finding. Either way it would hide a later finding of that rule there that nobody looked at.

How to fix

Delete the rule from the comment, or the comment when it names no other. A comment accepts the findings reported on its line; alone on its line, those on the next line of YAML; on a block scalar’s line (run: |), those in its text.

Example

# the workflow declares inputs.target now, so FP108 reports nothing on the next line
- run: echo "${{ inputs.target }}" # flowpact: ignore[FP108]

Scope

Not reported in generated files, which are not edited by hand.

Change the severity

Change the severity (or turn the rule off) in .github/flowpact/flowpact.config.yml, by code or by name:

.github/flowpact/flowpact.config.yml
rules:
  FP905: off
  # or: ignore-comment-unused: error

Explain it in the terminal:

flowpact explain FP905
  • FP904 ignore-comment-invalid: A # flowpact: ignore[…] comment names an unknown rule or one no comment can ignore, or is not written as ignore[<rules>].
  • FP902 override-unused: An override matches no finding — the problem was fixed, or the target is misspelled.
  • Ignore comments

On this page