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

Update SA1008 to require a space before the opening parenthesis if it's the left operand of a range expression #3895

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjornhellander
Copy link
Contributor

@bjornhellander bjornhellander commented Oct 17, 2024

Fixes #3894. There were code to forbid space before a parenthesizes expression which is part of a range expression. I updated that to only apply to the right operand.

Also added a collection expression test for SA1008, since it seemed related and I didn't find an existing test for it.

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.42%. Comparing base (2dc4507) to head (2d7e105).

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #3895       +/-   ##
===========================================
+ Coverage        0   97.42%   +97.42%     
===========================================
  Files           0      916      +916     
  Lines           0   110120   +110120     
  Branches        0     3319     +3319     
===========================================
+ Hits            0   107284   +107284     
- Misses          0     1860     +1860     
- Partials        0      976      +976     

…'s the left operand of a range expression. Also add test for SA1008 in collection expression.

DotNetAnalyzers#3894
@bjornhellander bjornhellander force-pushed the feature/sa1008-range-left-operand branch from d34096c to 2d7e105 Compare October 17, 2024 18:25
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.

SA1008 false positive on range expression with first operand in parentheses
1 participant