Skip to content

Conversation

@HerbigniauxBenoit
Copy link
Contributor

Implement rule in Rosylnator :
Use 'is' operator instead of 'as' operator: RCS1172

HerbigniauxBenoit and others added 13 commits May 20, 2025 11:54
Added a test to ensure the analyzer does not trigger
when the `as` operator is used in non-"not equals"
comparisons, specifically for null checks.
…e the use of the 'is' operator instead of the 'as' operator in C#. Refactored the relevant files and added detailed logic for analyzing syntax nodes and reporting diagnostics for inappropriate 'as' usage. Comprehensive unit tests have been included to validate the functionality of the new analyzer across various scenarios.
StanleySweet and others added 2 commits May 20, 2025 18:04
…he `UseIsOperatorInsteadOfAsOperator` class for improved readability. Added a new test in `UseIsOperatorInsteadOfAsOperatorTests` to ensure no diagnostics are reported when using the `as` operator with null conditional access, enhancing test coverage.
@StanleySweet StanleySweet force-pushed the dev/RCS1172_UseIsOperatorInsteadOfAsOperator branch from 957d47a to 2150a0d Compare May 21, 2025 07:36
@StanleySweet StanleySweet force-pushed the dev/RCS1172_UseIsOperatorInsteadOfAsOperator branch from 2150a0d to 0baaf89 Compare May 21, 2025 07:37
@vdebellabre vdebellabre merged commit 9b497b9 into green-code-initiative:main May 21, 2025
1 check passed
StanleySweet added a commit to StanleySweet/creedengo-rules-specifications that referenced this pull request May 21, 2025
StanleySweet added a commit to StanleySweet/creedengo-rules-specifications that referenced this pull request May 21, 2025
StanleySweet added a commit to StanleySweet/creedengo-rules-specifications that referenced this pull request May 21, 2025
StanleySweet added a commit to StanleySweet/creedengo-rules-specifications that referenced this pull request May 21, 2025
StanleySweet added a commit to StanleySweet/creedengo-rules-specifications that referenced this pull request May 21, 2025
StanleySweet added a commit to StanleySweet/creedengo-rules-specifications that referenced this pull request May 21, 2025
This is for green-code-initiative/creedengo-csharp#92

Co-authored-by: Benoit Herbigniaux <b.herbigniaux@hotmail.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants