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

C#: Add cs/useless-assignment-to-local to the code quality suite. #19061

Merged

Conversation

michaelnebel
Copy link
Contributor

@michaelnebel michaelnebel commented Mar 19, 2025

In this PR we

  • Add the cs/useless-assignment-to-local query to the code quality query suite.
  • Re-factor the tests to use inline expectations and add a test, which uses string interpolation.

@github-actions github-actions bot added the C# label Mar 19, 2025
@michaelnebel michaelnebel force-pushed the csharp/useless-assignment-to-local branch from 1066238 to 203cf92 Compare March 20, 2025 09:39
@michaelnebel michaelnebel force-pushed the csharp/useless-assignment-to-local branch 5 times, most recently from db6c29d to ffa35a7 Compare March 21, 2025 10:50
@michaelnebel michaelnebel force-pushed the csharp/useless-assignment-to-local branch from ffa35a7 to 7893a34 Compare March 27, 2025 15:23
@michaelnebel michaelnebel changed the title C#: Useless assignment to local. C#: Add cs/useless-assignment-to-local to the code quality suite. Mar 28, 2025
@michaelnebel michaelnebel force-pushed the csharp/useless-assignment-to-local branch 2 times, most recently from a296ab2 to 5dcaed8 Compare April 3, 2025 10:50
@michaelnebel michaelnebel force-pushed the csharp/useless-assignment-to-local branch from 5dcaed8 to dd1fbd2 Compare April 4, 2025 08:09
@michaelnebel michaelnebel marked this pull request as ready for review April 4, 2025 08:54
@michaelnebel michaelnebel requested a review from a team as a code owner April 4, 2025 08:54
@@ -157,7 +157,7 @@ public class OutParam
public void Test()
{
int x;
Fn(out x); // BAD
Fn(out x); // Missing Alert
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use $ MISSING: Alert instead

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And the same in other places.

@michaelnebel michaelnebel merged commit 8f0b985 into github:main Apr 4, 2025
17 checks passed
@michaelnebel michaelnebel deleted the csharp/useless-assignment-to-local branch April 4, 2025 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants