Skip to content

NEW @W-21364933@ Add suppression flag for the new inline suppression markers#2006

Merged
namrata111f merged 3 commits intodevfrom
ng-suppression-flag
Mar 20, 2026
Merged

NEW @W-21364933@ Add suppression flag for the new inline suppression markers#2006
namrata111f merged 3 commits intodevfrom
ng-suppression-flag

Conversation

@namrata111f
Copy link
Copy Markdown
Contributor

@namrata111f namrata111f commented Mar 16, 2026

As part of the Suppression epic, we are adding inline suppression markers. This feature will add performance impact in terms of space and time. Though not significant but considerable for large code bases (few seconds ~ 4s). Hence we want to only enable it for the users who want to particularly use it.

Tested following cases:
Case-1) When only --no-suppression flag is passed from cli. The violations are not suppressed:

% sf code-analyzer run -r all -c code-analyzer-parsing-test.yml -t utils.js --no-suppressions
=== Summary

Found 139 violation(s) across 1 file(s):
    12 High severity violation(s) found.
    78 Moderate severity violation(s) found.
    49 Low severity violation(s) found.

Case-2) When default values are used. Violations are suppressed:

% sf code-analyzer run -r all -c code-analyzer-parsing-test.yml -t utils.js
Code Analyzer [7:57:30.534]:
    132 violation(s) were suppressed by inline suppression markers.
=== Summary

Found 7 violation(s) across 1 file(s):
    7 Moderate severity violation(s) found.

Case-3) When cli passes the --no-suppression flag but the config yml has it disabled, suppressions are honored:

suppressions:
    disable_suppressions: false
 % sf code-analyzer run -r all -c code-analyzer-parsing-test.yml -t utils.js --no-suppressions
 Code Analyzer [7:53:49.11]:
    132 violation(s) were suppressed by inline suppression markers.
=== Summary

Found 7 violation(s) across 1 file(s):
    7 Moderate severity violation(s) found.

Case-4) When the flag is set false from config yaml:

suppressions:
    disable_suppressions: true
% sf code-analyzer run -r all -c code-analyzer-parsing-test.yml -t utils.js
=== Summary

Found 139 violation(s) across 1 file(s):
    12 High severity violation(s) found.
    78 Moderate severity violation(s) found.
    49 Low severity violation(s) found.

@namrata111f namrata111f force-pushed the ng-suppression-flag branch from 1c3c28e to db274c3 Compare March 18, 2026 10:02
Copy link
Copy Markdown
Contributor

@aruntyagiTutu aruntyagiTutu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config validation is not required ?

@namrata111f
Copy link
Copy Markdown
Contributor Author

namrata111f commented Mar 20, 2026

config validation is not required ?

@aruntyagiTutu Config validation was added as part of the core PR: forcedotcom/code-analyzer-core#440

@namrata111f namrata111f merged commit 14c35a1 into dev Mar 20, 2026
17 checks passed
@namrata111f namrata111f deleted the ng-suppression-flag branch March 20, 2026 04:34
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.

2 participants