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

Rule S2365: Fix code examples in RSPEC #9254

Closed
RobSiklos opened this issue May 3, 2024 · 1 comment
Closed

Rule S2365: Fix code examples in RSPEC #9254

RobSiklos opened this issue May 3, 2024 · 1 comment
Assignees
Labels
Type: Improvement Making existing code better.
Projects
Milestone

Comments

@RobSiklos
Copy link

RobSiklos commented May 3, 2024

In the documentation for the csharpsquid:S2365 rule, both code examples in the "How can I fix it?" section are incorrect.

The noncompliant example says it makes an "expensive ToList call", but no such call is made.

Both solutions try to call Clone() on a List<>, but no such method exists, and even if it did, casting to a string[] would likely not work.

Looks like the author rushed through this one and didn't complete the examples correctly.

@sebastien-marichal sebastien-marichal self-assigned this May 6, 2024
@sebastien-marichal
Copy link
Contributor

Hello @RobSiklos,

Thank you for reporting this!

I agree the code examples are not correct.
I will update them to better reflect the rule.

@sebastien-marichal sebastien-marichal added the Type: Improvement Making existing code better. label May 7, 2024
@sebastien-marichal sebastien-marichal added this to the 9.26 milestone May 7, 2024
@github-actions github-actions bot added this to To do in Best Kanban May 7, 2024
@sebastien-marichal sebastien-marichal changed the title Docs: The compliant/non-compliant code examples for csharpsquid:S2365 are incorrect Rule S2365: Fix code examples in RSPEC May 7, 2024
Best Kanban automation moved this from To do to Validate Peach May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement Making existing code better.
Projects
Best Kanban
  
Validate Peach
Development

No branches or pull requests

2 participants