Skip to content

Add // soroban-guard: allow(check-name) inline suppression annotation support #148

Description

@lonerthefirst3-sudo

Summary

Allow developers to suppress a specific finding on a line or function by adding an inline annotation comment immediately above the offending code:

// soroban-guard: allow(unchecked-arithmetic)
let result = a + b;

Or to suppress all findings in a function:

// soroban-guard: allow(missing-require-auth)
pub fn bootstrap(env: Env) {}

Why it matters

Intentional false-positive patterns (known-safe code, test helpers, migration bootstraps) currently require --disable-check which silences the check for the entire scan. Per-line suppression is the standard approach in linting tools (clippy #[allow(...)], eslint // eslint-disable-next-line).

Implementation hints

  • Parse the source string (passed to Check::run) for // soroban-guard: allow(...) lines
  • Build a HashSet<(line, check_name)> of suppressed positions
  • After all checks run, filter findings against this set before returning
  • Document the syntax in docs/false-positives.md

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions