Skip to content

Suppression #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 19 commits into from
Apr 9, 2015
Merged

Suppression #18

merged 19 commits into from
Apr 9, 2015

Conversation

quoctruong
Copy link

This prototype add support for suppressing rule. The syntax supported in this prototype is
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("RuleName", "RuleSuppressionID")]. Any arguments supplied beyond that will be ignored.

This attribute can be used with classes, functions in classes or normal functions. Normal functions need to have param block to use this feature (the attribute will be placed on top of the param block).

To use this attribute at the script level, the script needs to have a param block (again the attribute will be placed on top of the param block).

In this prototype, RuleSuppressionID is only implemented for AvoidUninitializedVariable (of the form PSAvoidUninitializedVariable). If this argument is supplied, then we will only suppress diagnostic record that matches the RuleSuppressionID.

{
List<RuleSuppression> ruleSuppressionList = new List<RuleSuppression>();

ScriptBlockAst sbAst = ast as ScriptBlockAst;
Copy link
Member

Choose a reason for hiding this comment

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

Check for null ast?

Copy link
Author

Choose a reason for hiding this comment

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

I'll add a check

@yutingc
Copy link
Contributor

yutingc commented Apr 9, 2015

LGTM.

@raghushantha
Copy link
Member

pls merge the pull request. looks good

@quoctruong
Copy link
Author

Thanks. Merged!

quoctruong pushed a commit that referenced this pull request Apr 9, 2015
Add prototype for suppressing rule
@quoctruong quoctruong merged commit a2fff13 into development Apr 9, 2015
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.

3 participants