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

Allow "WithConcurrentAnalysis" in more places #6398

Open
martin-strecker-sonarsource opened this issue Nov 21, 2022 · 0 comments
Open

Allow "WithConcurrentAnalysis" in more places #6398

martin-strecker-sonarsource opened this issue Nov 21, 2022 · 0 comments
Labels
Area: C# C# rules related issues. Type: Cleanup Improve and cleanup code base

Comments

@martin-strecker-sonarsource
Copy link
Contributor

martin-strecker-sonarsource commented Nov 21, 2022

In the tests, we create a copy of the original test file and analyze it in parallel with the original one. To avoid compiler errors related to name clashes, we encapsulate the new code in a separate namespace like so "namespace {" + original + "}".

This doesn't work for

  • file-scoped namespaces
  • file header comments
  • assembly attributes

because it causes compiler errors or analyzer failures on its own. When the above are needed in test files, the dev must remember to set .WithConcurrentAnalysis(false).

We need to insert the concurrent namespace in a smarter way to avoid the issues described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: C# C# rules related issues. Type: Cleanup Improve and cleanup code base
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants