SA1118 still issues warning eventhough disabled in *.ruleset
See original GitHub issueEnvironment: VS2017, StyleCop.Analyzers 1.0.2.
I disabled SA1118 (None or Hidden), the editor doesn’t show warning but running build still issues warning in this case:
public static readonly EmailTemplateDefinition TestEmail = new EmailTemplateDefinition(
name: "app.email-templates.test-email",
subject: "Test email ignore please",
body: @"<p>This is test email, please ignore.</p>
<p></p>
<p>---</p>
<p>FxCompanyName</p>",
editable: false);
Calling inside another method doesn’t produce any warning.
Disable by pragma
doesn’t work too. Workaround using SuppressMessage
ok.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
StyleCopAnalyzers/documentation/SA1118.md at master
An implementation of StyleCop rules using the .NET Compiler Platform - StyleCopAnalyzers/documentation/SA1118.md at master ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry, I think I found the problem. I migrated my project from Stylecop.MSBuild.Targets but forgot to remove the link to the target file. So that warning is from the old one. When I tried in other situations, I placed the long params at the first parameter so it passed the rule.
PS: the old Stylecop rule statement is missing this part
other than the first parameter
so I didn’t recognize that:👍 glad to hear it’s worked out!