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

Add Argument tracker and tests #8950

Merged

Conversation

martin-strecker-sonarsource
Copy link
Contributor

@martin-strecker-sonarsource martin-strecker-sonarsource commented Mar 18, 2024

Adds an ArgumentDescriptor and logic to match an ArgumentSyntax against it.
Based on #8947

Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
1 New issue
83.3% Coverage on New Code (required ≥ 95%)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

Copy link

sonarcloud bot commented Apr 24, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@github-actions github-actions bot moved this from Review in progress to In progress in Best Kanban Apr 25, 2024
&& Language.MethodParameterLookup(invoked, methodSymbol).TryGetSymbol(argumentNode, out var parameter)
&& ParameterFits(parameter, descriptor.ParameterConstraint, descriptor.InvokedMemberConstraint))
{
context.Parameter = parameter;

Choose a reason for hiding this comment

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

I find it very confusing that this method has side effects. Will this used only in tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will this used only in tests?

Unfortunately not. The rule PR uses this call.

this method has side effects

Yes. This is very unfortunate. There should be a distinction between input and output, but the context is both at the moment. This is how the tracker is designed now: It creates a pipeline of matchers and passes the context from one to the others. Each matcher can manipulate parts of the context. (It's a bit like the request pipeline in asp.net core).

Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Passed Quality Gate passed for 'Sonar .NET Java Plugin'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

Copy link

sonarcloud bot commented May 14, 2024

Quality Gate Failed Quality Gate failed for 'SonarAnalyzer for .NET'

Failed conditions
85.7% Coverage on New Code (required ≥ 95%)

See analysis details on SonarCloud

@costin-zaharia-sonarsource costin-zaharia-sonarsource merged commit c117342 into feature/New_S6932 May 14, 2024
25 of 26 checks passed
Best Kanban automation moved this from In progress to Validate Peach May 14, 2024
@costin-zaharia-sonarsource costin-zaharia-sonarsource deleted the Martin/ArgumentDescriptor branch May 14, 2024 15:40
costin-zaharia-sonarsource pushed a commit that referenced this pull request May 15, 2024
Co-authored-by: Gregory Paidis <gregory.paidis@sonarsource.com>
@martin-strecker-sonarsource martin-strecker-sonarsource moved this from Validate Peach to Done in Best Kanban May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Best Kanban
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants