Skip to content

Support line-level suppression for individual findings #554

Description

@mcowger

What problem does this solve?

Cora currently has no line-level suppression for a finding that is a false positive or intentionally accepted.

For example, bytesPerToken is flagged as Hardcoded password or secret in variable, even though it is a normal non-secret variable name.

The available config suppression is broader:

ignore:
  rules:
    - "Hardcoded password or secret in variable"

That suppresses every finding with that title across the project. ignore.files excludes whole files.

Proposed solution

Add a documented, rule-scoped inline suppression marker, with syntax that works across supported languages. The exact syntax can be decided as part of implementation.

A line-level suppression should:

  • suppress only the selected finding at the selected location;
  • leave other rules on the same line and elsewhere visible;
  • support targeting a specific rule rather than disabling review for the whole line or file;
  • coexist with the existing project-wide rule and file suppressions.

For example, the bytesPerToken false positive should be suppressible without hiding unrelated Hardcoded password or secret in variable findings elsewhere in the project.

Alternatives considered

  • ignore.rules suppresses every finding with the same title across the project.
  • ignore.files suppresses findings for an entire file.
  • Inline markers such as // cora-ignore, // noqa, and // eslint-disable are not currently documented or recognized by Cora.

Are you willing to contribute the implementation?

Yes, if you are open to the idea.

Before submitting

  • I searched existing issues and didn't find a duplicate

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions