Skip to content

RFE: options to require rules and justfication for inline annotations #1662

@scop

Description

@scop

It would be nice if gosec had options to require specifying

  • at least one rule to inline #nosec/gosec:disable annotations (i.e. ban "naked" directives without any rules), in order to avoid inadvertently suppressing other than intended rules that might apply
  • a justification present in all #nosec/gosec:disable annotations, for rationale as it is not always obvious, and this is quite probably security sensitive stuff

For example, golangci-lint (nolint) and revive (revive:disable*) already have these (revive only for justification/reasoning at time of writing).

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