-
Notifications
You must be signed in to change notification settings - Fork 186
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
Ignore code analysis warnings in extension files #21
Comments
You can also use the global suppression file technique to suppress any messages from files you don't want to edit, i.e. linked ones like this. |
Took me some time to get this right. The trick was to set the using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage(
"Design",
"CA1823",
Justification = "Auto-generated code.",
Scope = "namespaceanddescendants",
Target = "~N:Microsoft.Azure.WebJobs.Extensions")]
[assembly: SuppressMessage(
"Design",
"MEN002",
Justification = "Auto-generated code.",
Scope = "namespaceanddescendants",
Target = "~N:Microsoft.Azure.WebJobs.Extensions")]
[assembly: SuppressMessage(
"Design",
"SA1206",
Justification = "Auto-generated code.",
Scope = "namespaceanddescendants",
Target = "~N:Microsoft.Azure.WebJobs.Extensions")]
[assembly: SuppressMessage(
"Layout Rules",
"SA1311",
Justification = "Auto-generated code.",
Scope = "namespaceanddescendants",
Target = "~N:Microsoft.Azure.WebJobs.Extensions")]
[assembly: SuppressMessage(
"Layout Rules",
"SA1500",
Justification = "Auto-generated code.",
Scope = "namespaceanddescendants",
Target = "~N:Microsoft.Azure.WebJobs.Extensions")]
[assembly: SuppressMessage(
"Readability Rules",
"SX1101",
Justification = "Auto-generated code.",
Scope = "namespaceanddescendants",
Target = "~N:Microsoft.Azure.WebJobs.Extensions")] Still, I would consider this a workaround (which I'm fine with for now). |
Thanks for raising this issue! It's being merged and will be shipped in the next iteration. Once it's shipped, I'll close this issue for you to have a look on your end. |
It's been released to NuGet. Please have a look. |
I'm using the
0.1.0-preview
version in a C# Azure Functions V3 project, running on Linux with .NET Core SDK 3.1Our project uses Roslyn-based code analysis during the build. This extension adds some source files for compilation, but unfortunately, these are also picked up for analysis. I cannot find a way to ignore them (tried the .editorconfig approach, but that only works for files inside the repository).
I manually modified the files and added
// <auto-generated>
on the first line, which solves it 'temporary'.The text was updated successfully, but these errors were encountered: