Skip to content

feat: implement Soroban Rule Suppression Framework (#476)#562

Open
zoffunjunior381-jpg wants to merge 1 commit into
MDTechLabs:mainfrom
zoffunjunior381-jpg:feat/issue-476-rule-suppression
Open

feat: implement Soroban Rule Suppression Framework (#476)#562
zoffunjunior381-jpg wants to merge 1 commit into
MDTechLabs:mainfrom
zoffunjunior381-jpg:feat/issue-476-rule-suppression

Conversation

@zoffunjunior381-jpg

Copy link
Copy Markdown

Closes #476
Closes #477
Closes #478

Summary

Adds a RuleSuppressionFramework class at src/suppressions/stellar/ that lets developers suppress specific rule findings both inline and via configuration.


#476 — Implement Soroban Rule Suppression Framework

Path: src/suppressions/stellar/

Files:

  • types.tsInlineSuppression, ConfigSuppression, Finding, SuppressionRecord, SuppressionFilterResult, and config types
  • rule-suppression-framework.tsRuleSuppressionFramework class + parseInlineSuppressions helper
  • index.ts — barrel export

Inline suppressions — parsed from source annotations:

// gasguard-suppress: GG001 -- acceptable in single-owner contract

Multi-rule syntax also supported: // gasguard-suppress: GG001,GG002 -- reason

Config suppressions — registered programmatically:

framework.addConfigSuppression({ source: 'config', ruleId: 'GG002', scope: 'global', reason: '...' });
framework.addConfigSuppression({ source: 'config', ruleId: 'GG003', scope: 'contracts/legacy/**', reason: '...' });

Scope supports 'global' and file globs (* and **).

Filtering:

const { active, suppressed } = framework.filter(findings);
// active   → include in reports
// suppressed → each entry has .finding, .suppression (with .reason), and .suppressedAt

Optional warnOnSuppression: true and onSuppressed callback for CI audit trails.

Closes MDTechLabs#476
Closes MDTechLabs#477
Closes MDTechLabs#478

- MDTechLabs#476: Implement Soroban Rule Suppression Framework
  src/suppressions/stellar/

  RuleSuppressionFramework allows developers to suppress specific rule
  findings via two mechanisms:
  1. Inline annotations: // gasguard-suppress: GG001 -- reason here
     Parsed from source text with parseInlineSuppressions(); matched to
     findings on the same or immediately preceding line in the same file.
  2. Config suppressions: registered via addConfigSuppression() with a
     scope of 'global' or a file glob (supports * and ** patterns).
  filter() returns { active, suppressed } — suppressed findings carry a
  SuppressionRecord including the matched suppression and reason.
  Optionally fires warnOnSuppression and an onSuppressed callback for
  audit trails in CI pipelines.
@drips-wave

drips-wave Bot commented Jun 28, 2026

Copy link
Copy Markdown

@zoffunjunior381-jpg Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Soroban Rule Dependency Engine Implement Soroban Contract Entrypoint Analyzer Implement Soroban Rule Suppression Framework

1 participant