File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed
Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -615,6 +615,14 @@ public bool HasSpecialVars(string varName)
615615 public Dictionary < string , List < RuleSuppression > > GetRuleSuppression ( Ast ast )
616616 {
617617 List < RuleSuppression > ruleSuppressionList = new List < RuleSuppression > ( ) ;
618+
619+ ScriptBlockAst sbAst = ast as ScriptBlockAst ;
620+
621+ // Get rule suppression from the ast itself if it is scriptblockast
622+ if ( sbAst != null && sbAst . ParamBlock != null && sbAst . ParamBlock . Attributes != null )
623+ {
624+ ruleSuppressionList . AddRange ( RuleSuppression . GetSuppressions ( sbAst . ParamBlock . Attributes , sbAst . Extent . StartOffset , sbAst . Extent . EndOffset ) ) ;
625+ }
618626
619627 // Get rule suppression from functions
620628 IEnumerable < FunctionDefinitionAst > funcAsts = ast . FindAll ( item => item is FunctionDefinitionAst , true ) . Cast < FunctionDefinitionAst > ( ) ;
You can’t perform that action at this time.
0 commit comments