Skip to content
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

Suppress e.g., CA1861 for certain project types #38633

Open
vsfeedback opened this issue Dec 6, 2023 · 1 comment · May be fixed by #40846
Open

Suppress e.g., CA1861 for certain project types #38633

vsfeedback opened this issue Dec 6, 2023 · 1 comment · May be fixed by #40846
Assignees
Labels
in-pr This issue will be closed (fixed) by an active pull request. 📌 seQUESTered Identifies that an issue has been imported into Quest.

Comments

@vsfeedback
Copy link

vsfeedback commented Dec 6, 2023

This issue has been moved from a ticket on Developer Community.


After the upgrade to .NET 8 / VS 2022 17.8 a new message pops up: CA1861 Prefer 'static readonly' fields over constant array arguments if the called method is called repeatedly and is not mutating the passed array.

This is a useful diagnostic to have for production code, but it pops up a lot in my unit tests that verify whether some code produces the required list of things. I now have a choice to disable it completely, add an .editorconfig to all my unit test projects, or live with tons of blue squiggles in test code. I'll do the first, but that is obviously not why you introduced this analytics. But I can't see a way to disable the issue in a single .editorconfig file for all projects in the directory tree that satisfy a condition. Please provide such an optio

(this may be more of a suggestion, but for me all those new messages are a problem)


Document Details

Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.


Associated WorkItem - 250216

@mavasani mavasani transferred this issue from dotnet/roslyn-analyzers Dec 6, 2023
@dotnet-bot dotnet-bot added the ⌚ Not Triaged Not triaged label Dec 6, 2023
@mavasani
Copy link
Member

mavasani commented Dec 6, 2023

See https://developercommunity.visualstudio.com/t/Suppress-eg-CA1861-for-certain-projec/10525308#T-N10530664 for the documentation enhancement suggestion from the customer

@gewarren gewarren self-assigned this Apr 2, 2024
@gewarren gewarren added 🗺️ reQUEST Triggers an issue to be imported into Quest. and removed ⌚ Not Triaged Not triaged Pri3 labels Apr 29, 2024
@sequestor sequestor bot added 📌 seQUESTered Identifies that an issue has been imported into Quest. and removed 🗺️ reQUEST Triggers an issue to be imported into Quest. labels Apr 30, 2024
@dotnet-policy-service dotnet-policy-service bot added the in-pr This issue will be closed (fixed) by an active pull request. label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in-pr This issue will be closed (fixed) by an active pull request. 📌 seQUESTered Identifies that an issue has been imported into Quest.
Projects
Status: 👀 In review
Development

Successfully merging a pull request may close this issue.

4 participants