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 not crash if there is no previous token #3741

Merged

Conversation

bjornhellander
Copy link
Contributor

@bjornhellander bjornhellander commented Dec 3, 2023

Fixes #2354

Protected all similar methods in LocationHelpers against null reference exception.
I found one situation where this happens in SA1008 so I added a unit test for that as well.

I also went through all uses of the SyntaxTree properties in SyntaxToken, SyntaxTrivia and SyntaxNodeOrToken and tried to make sure that they could not cause a null reference exceptions.

Copy link

codecov bot commented Dec 3, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (be49652) 97.40% compared to head (68c49ff) 94.45%.
Report is 6 commits behind head on master.

❗ Current head 68c49ff differs from pull request most recent head 6b7973e. Consider uploading reports for the commit 6b7973e to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3741      +/-   ##
==========================================
- Coverage   97.40%   94.45%   -2.95%     
==========================================
  Files         914      908       -6     
  Lines      108762   108717      -45     
  Branches     3284     3285       +1     
==========================================
- Hits       105937   102688    -3249     
- Misses       1847     5003    +3156     
- Partials      978     1026      +48     

@bjornhellander bjornhellander changed the title [WIP] Update LocationHelpers to not crash if SyntaxTree is null Update LocationHelpers to not crash if SyntaxTree is null Dec 3, 2023
@bjornhellander
Copy link
Contributor Author

Ready for review

Copy link
Member

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

I would prefer to not move in this direction. If token.SyntaxTree can be null somewhere, we should check for null at the location where a possible-null is originally introduced.

@bjornhellander
Copy link
Contributor Author

Alright. I fear it will be hard to fix "all" cases that way, but we will see what I can do. SA1008 should be easy anyway.

@bjornhellander bjornhellander changed the title Update LocationHelpers to not crash if SyntaxTree is null Update SA1008 to not crash if there is no previous token Dec 16, 2023
@bjornhellander
Copy link
Contributor Author

Updated to only handle SA1008.

@@ -100,6 +100,9 @@ private static void HandleOpenParenToken(SyntaxTreeAnalysisContext context, Synt
bool precededByKeyword;
switch (prevToken.Kind())
{
case SyntaxKind.None:
return;
Copy link
Member

Choose a reason for hiding this comment

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

📝 This won't correctly handle the following top-level program:

 ( var a, var b) = (3, 3);
System.Console.WriteLine($"{a}");

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Didn't think of that.
Alright, I will have a look.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see now that you added both a leading and a trailing space in your example. What was your intention with the leading space? What is the expected result?

Copy link
Member

Choose a reason for hiding this comment

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

It should behave the same way as this:

void Method()
{
     ( var a, var b) = (3, 3);
    System.Console.WriteLine($"{a}");
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can understand, this is a "don't care" case, since it is the first token on the line

@bjornhellander
Copy link
Contributor Author

Test execution seems to fail without a reason in the previous build. I noticed that both OpenCover and xunit.runner.console are quite old (from 2016 and 2018). What do you think about updating them?

@sharwell
Copy link
Member

Test execution seems to fail without a reason in the previous build.

I think this is a different issue that I can likely work around in the build system.

@bjornhellander
Copy link
Contributor Author

Test execution seems to fail without a reason in the previous build.

I think this is a different issue that I can likely work around in the build system.

Absolutely, I didn't mean in this PR. It looked like the test runner just died before reporting the outcome in the c# 6 debug run and in the c# 12 debug run, all tests passed but opencover.console.exe exited with code 1 without saying why. Just looked weird, so upgrading them might be a good thing. Unless you already had ideas about it.

@sharwell sharwell merged commit 497c50a into DotNetAnalyzers:master Dec 19, 2023
18 of 19 checks passed
@sharwell sharwell added this to the 1.2-beta.next milestone Dec 19, 2023
@bjornhellander bjornhellander deleted the sa1008-null-exception branch December 19, 2023 19:27
renovate bot added a commit to smartive/cas-fee-adv-mumble-api that referenced this pull request Dec 21, 2023
…20)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[StyleCop.Analyzers](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers)
| `1.2.0-beta.507` -> `1.2.0-beta.556` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/StyleCop.Analyzers/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/StyleCop.Analyzers/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/StyleCop.Analyzers/1.2.0-beta.507/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/StyleCop.Analyzers/1.2.0-beta.507/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>DotNetAnalyzers/StyleCopAnalyzers
(StyleCop.Analyzers)</summary>

###
[`v1.2.0-beta.556`](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/releases/tag/1.2.0-beta.556)

[Compare
Source](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/compare/1.2.0-beta.553...1.2.0-beta.556)

#### What's Changed

- Update SA1011 to forbid trailing space before the end of a switch case
by [@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3674
- Rewrite IOperationWrapper as a wrapper structure around IOperation by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3611
- Update SA1202 to support interfaces (C# 8) and records (C# 9, 10) by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3694
- Update documentation for SA1308 to also mention prefix "t\_" by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3697
- Update SA1642 and its code fix to handle record structs correctly by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3696
- Update dependencies by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3700
- Mark several test classes as partial by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3702
- Add missing test files and fix inheritance by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3703
- Generate and validate derived test classes by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3704
- Update SA1011 to not require space before a range operator by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3709
- Update SA1131 to treat methods as constants by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3710
- Avoid allocations in CanWrap... methods by
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- Update SA1648 to accept inheritdoc on members implemented from static
abstract/virtual interface members by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3715
- Update SA1600 to also handle records by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3725
- Update SA1119 to allow parenthesis around a ref ternary conditional
expression when it is the left-hand side of an assigment by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3737
- Update SA1119 to allow parenthesized switch expressions followed by an
invocation by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3733
- Add c# 12 test project by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3734
- Run tests in parallel jobs by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3740
- Update SA1010 to accept whitespace before collection initializers by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3745
- Update SA1513 to not require a blank line if the closing brace is at
the end of a collection expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3746
- Update SA1118 to allow multi-line collection expressions by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3749
- Update SA1009 to require a space after the closing parenthesis if it
is followed by ++ or -- from a prefix unary expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3750
- Update SA1008 to allow space before the opening parenthesis of a using
alias definition of a tuple type by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3748
- Update documentation for SA1102 to contain compilable code examples by
[@&#8203;arphox](https://togithub.com/arphox) in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- Update SA1008 to not crash if there is no previous token by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3741
- Change default value of test property CodeActionValidationMode to
SemanticStructure instead of None and update so that tests still pass by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3753
- Allow inheritdoc for class constructors with base types by
[@&#8203;MartyIX](https://togithub.com/MartyIX) in
[DotNetAnalyzers/StyleCopAnalyzers#3719
- Fix that SA1134 Fix All maybe non-deterministic by
[@&#8203;pdelvo](https://togithub.com/pdelvo) in
[DotNetAnalyzers/StyleCopAnalyzers#2853
- Coverage improvements by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3675
- Fix SA1131 to not treat "complex" expressions as a literal by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3760

#### New Contributors

-
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
made their first contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- [@&#8203;arphox](https://togithub.com/arphox) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- [@&#8203;MartyIX](https://togithub.com/MartyIX) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3719

**Full Changelog**:
DotNetAnalyzers/StyleCopAnalyzers@1.2.0-beta.507...1.2.0-beta.556

###
[`v1.2.0-beta.553`](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/releases/tag/1.2.0-beta.553)

[Compare
Source](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/compare/1.2.0-beta.507...1.2.0-beta.553)

##### What's Changed

- Update SA1011 to forbid trailing space before the end of a switch case
by [@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3674
- Rewrite IOperationWrapper as a wrapper structure around IOperation by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3611
- Update SA1202 to support interfaces (C# 8) and records (C# 9, 10) by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3694
- Update documentation for SA1308 to also mention prefix "t\_" by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3697
- Update SA1642 and its code fix to handle record structs correctly by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3696
- Update dependencies by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3700
- Mark several test classes as partial by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3702
- Add missing test files and fix inheritance by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3703
- Generate and validate derived test classes by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3704
- Update SA1011 to not require space before a range operator by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3709
- Update SA1131 to treat methods as constants by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3710
- Avoid allocations in CanWrap... methods by
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- Update SA1648 to accept inheritdoc on members implemented from static
abstract/virtual interface members by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3715
- Update SA1600 to also handle records by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3725
- Update SA1119 to allow parenthesis around a ref ternary conditional
expression when it is the left-hand side of an assigment by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3737
- Update SA1119 to allow parenthesized switch expressions followed by an
invocation by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3733
- Add c# 12 test project by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3734
- Run tests in parallel jobs by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3740
- Update SA1010 to accept whitespace before collection initializers by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3745
- Update SA1513 to not require a blank line if the closing brace is at
the end of a collection expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3746
- Update SA1118 to allow multi-line collection expressions by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3749
- Update SA1009 to require a space after the closing parenthesis if it
is followed by ++ or -- from a prefix unary expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3750
- Update SA1008 to allow space before the opening parenthesis of a using
alias definition of a tuple type by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3748
- Update documentation for SA1102 to contain compilable code examples by
[@&#8203;arphox](https://togithub.com/arphox) in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- Update SA1008 to not crash if there is no previous token by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3741
- Change default value of test property CodeActionValidationMode to
SemanticStructure instead of None and update so that tests still pass by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3753
- Allow inheritdoc for class constructors with base types by
[@&#8203;MartyIX](https://togithub.com/MartyIX) in
[DotNetAnalyzers/StyleCopAnalyzers#3719
- Fix that SA1134 Fix All maybe non-deterministic by
[@&#8203;pdelvo](https://togithub.com/pdelvo) in
[DotNetAnalyzers/StyleCopAnalyzers#2853
- Coverage improvements by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3675

##### New Contributors

-
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
made their first contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- [@&#8203;arphox](https://togithub.com/arphox) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- [@&#8203;MartyIX](https://togithub.com/MartyIX) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3719

**Full Changelog**:
DotNetAnalyzers/StyleCopAnalyzers@1.2.0-beta.507...1.2.0-beta.553

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 9pm,before 6am" in timezone
Europe/Zurich, Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/smartive/cas-fee-adv-mumble-api).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
ThorstenSauter pushed a commit to ThorstenSauter/NoPlan that referenced this pull request Dec 21, 2023
…591)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[StyleCop.Analyzers](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers)
| `1.2.0-beta.507` -> `1.2.0-beta.556` |
[![age](https://developer.mend.io/api/mc/badges/age/nuget/StyleCop.Analyzers/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/nuget/StyleCop.Analyzers/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/nuget/StyleCop.Analyzers/1.2.0-beta.507/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/StyleCop.Analyzers/1.2.0-beta.507/1.2.0-beta.556?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>DotNetAnalyzers/StyleCopAnalyzers
(StyleCop.Analyzers)</summary>

###
[`v1.2.0-beta.556`](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/releases/tag/1.2.0-beta.556)

[Compare
Source](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/compare/1.2.0-beta.553...1.2.0-beta.556)

#### What's Changed

- Update SA1011 to forbid trailing space before the end of a switch case
by [@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3674
- Rewrite IOperationWrapper as a wrapper structure around IOperation by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3611
- Update SA1202 to support interfaces (C# 8) and records (C# 9, 10) by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3694
- Update documentation for SA1308 to also mention prefix "t\_" by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3697
- Update SA1642 and its code fix to handle record structs correctly by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3696
- Update dependencies by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3700
- Mark several test classes as partial by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3702
- Add missing test files and fix inheritance by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3703
- Generate and validate derived test classes by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3704
- Update SA1011 to not require space before a range operator by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3709
- Update SA1131 to treat methods as constants by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3710
- Avoid allocations in CanWrap... methods by
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- Update SA1648 to accept inheritdoc on members implemented from static
abstract/virtual interface members by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3715
- Update SA1600 to also handle records by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3725
- Update SA1119 to allow parenthesis around a ref ternary conditional
expression when it is the left-hand side of an assigment by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3737
- Update SA1119 to allow parenthesized switch expressions followed by an
invocation by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3733
- Add c# 12 test project by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3734
- Run tests in parallel jobs by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3740
- Update SA1010 to accept whitespace before collection initializers by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3745
- Update SA1513 to not require a blank line if the closing brace is at
the end of a collection expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3746
- Update SA1118 to allow multi-line collection expressions by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3749
- Update SA1009 to require a space after the closing parenthesis if it
is followed by ++ or -- from a prefix unary expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3750
- Update SA1008 to allow space before the opening parenthesis of a using
alias definition of a tuple type by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3748
- Update documentation for SA1102 to contain compilable code examples by
[@&#8203;arphox](https://togithub.com/arphox) in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- Update SA1008 to not crash if there is no previous token by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3741
- Change default value of test property CodeActionValidationMode to
SemanticStructure instead of None and update so that tests still pass by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3753
- Allow inheritdoc for class constructors with base types by
[@&#8203;MartyIX](https://togithub.com/MartyIX) in
[DotNetAnalyzers/StyleCopAnalyzers#3719
- Fix that SA1134 Fix All maybe non-deterministic by
[@&#8203;pdelvo](https://togithub.com/pdelvo) in
[DotNetAnalyzers/StyleCopAnalyzers#2853
- Coverage improvements by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3675
- Fix SA1131 to not treat "complex" expressions as a literal by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3760

#### New Contributors

-
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
made their first contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- [@&#8203;arphox](https://togithub.com/arphox) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- [@&#8203;MartyIX](https://togithub.com/MartyIX) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3719

**Full Changelog**:
DotNetAnalyzers/StyleCopAnalyzers@1.2.0-beta.507...1.2.0-beta.556

###
[`v1.2.0-beta.553`](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/releases/tag/1.2.0-beta.553)

[Compare
Source](https://togithub.com/DotNetAnalyzers/StyleCopAnalyzers/compare/1.2.0-beta.507...1.2.0-beta.553)

##### What's Changed

- Update SA1011 to forbid trailing space before the end of a switch case
by [@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3674
- Rewrite IOperationWrapper as a wrapper structure around IOperation by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3611
- Update SA1202 to support interfaces (C# 8) and records (C# 9, 10) by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3694
- Update documentation for SA1308 to also mention prefix "t\_" by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3697
- Update SA1642 and its code fix to handle record structs correctly by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3696
- Update dependencies by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3700
- Mark several test classes as partial by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3702
- Add missing test files and fix inheritance by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3703
- Generate and validate derived test classes by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3704
- Update SA1011 to not require space before a range operator by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3709
- Update SA1131 to treat methods as constants by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3710
- Avoid allocations in CanWrap... methods by
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- Update SA1648 to accept inheritdoc on members implemented from static
abstract/virtual interface members by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3715
- Update SA1600 to also handle records by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3725
- Update SA1119 to allow parenthesis around a ref ternary conditional
expression when it is the left-hand side of an assigment by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3737
- Update SA1119 to allow parenthesized switch expressions followed by an
invocation by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3733
- Add c# 12 test project by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3734
- Run tests in parallel jobs by
[@&#8203;sharwell](https://togithub.com/sharwell) in
[DotNetAnalyzers/StyleCopAnalyzers#3740
- Update SA1010 to accept whitespace before collection initializers by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3745
- Update SA1513 to not require a blank line if the closing brace is at
the end of a collection expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3746
- Update SA1118 to allow multi-line collection expressions by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3749
- Update SA1009 to require a space after the closing parenthesis if it
is followed by ++ or -- from a prefix unary expression by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3750
- Update SA1008 to allow space before the opening parenthesis of a using
alias definition of a tuple type by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3748
- Update documentation for SA1102 to contain compilable code examples by
[@&#8203;arphox](https://togithub.com/arphox) in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- Update SA1008 to not crash if there is no previous token by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3741
- Change default value of test property CodeActionValidationMode to
SemanticStructure instead of None and update so that tests still pass by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3753
- Allow inheritdoc for class constructors with base types by
[@&#8203;MartyIX](https://togithub.com/MartyIX) in
[DotNetAnalyzers/StyleCopAnalyzers#3719
- Fix that SA1134 Fix All maybe non-deterministic by
[@&#8203;pdelvo](https://togithub.com/pdelvo) in
[DotNetAnalyzers/StyleCopAnalyzers#2853
- Coverage improvements by
[@&#8203;bjornhellander](https://togithub.com/bjornhellander) in
[DotNetAnalyzers/StyleCopAnalyzers#3675

##### New Contributors

-
[@&#8203;martin-strecker-sonarsource](https://togithub.com/martin-strecker-sonarsource)
made their first contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3711
- [@&#8203;arphox](https://togithub.com/arphox) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3755
- [@&#8203;MartyIX](https://togithub.com/MartyIX) made their first
contribution in
[DotNetAnalyzers/StyleCopAnalyzers#3719

**Full Changelog**:
DotNetAnalyzers/StyleCopAnalyzers@1.2.0-beta.507...1.2.0-beta.553

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/ThorstenSauter/NoPlan).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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 threw a NullReferenceException
2 participants