Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update SA1212 to also trigger for an init accessor before a getter #3661

Merged

Conversation

bjornhellander
Copy link
Contributor

Fixes #3652.

@bjornhellander bjornhellander force-pushed the feature/sa1212-init-accessor branch from c5aab58 to 64e2ecc Compare May 23, 2023 18:55
@bjornhellander
Copy link
Contributor Author

Failing in "Install .NET Core SDK" for some reason. Will try again tomorrow.

@bjornhellander bjornhellander force-pushed the feature/sa1212-init-accessor branch from 64e2ecc to 6cae4cf Compare May 24, 2023 03:59
@codecov
Copy link

codecov bot commented May 24, 2023

Codecov Report

Merging #3661 (19e4f17) into master (b80f0c2) will increase coverage by 0.01%.
The diff coverage is 100.00%.

❗ Current head 19e4f17 differs from pull request most recent head 280b11a. Consider uploading reports for the commit 280b11a to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3661      +/-   ##
==========================================
+ Coverage   93.26%   93.27%   +0.01%     
==========================================
  Files        1080     1082       +2     
  Lines      113982   114226     +244     
  Branches     4045     4051       +6     
==========================================
+ Hits       106303   106547     +244     
  Misses       6641     6641              
  Partials     1038     1038              

@bjornhellander
Copy link
Contributor Author

Ready for review

@sharwell sharwell enabled auto-merge June 21, 2023 13:41
@sharwell sharwell merged commit 0e192df into DotNetAnalyzers:master Jun 21, 2023
@sharwell sharwell added this to the 1.2-beta.next milestone Jun 21, 2023
@bjornhellander bjornhellander deleted the feature/sa1212-init-accessor branch June 21, 2023 18:36
ThorstenSauter referenced this pull request in ThorstenSauter/NoPlan Jun 22, 2023
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[StyleCop.Analyzers](https://github.com/DotNetAnalyzers/StyleCopAnalyzers)
| nuget | patch | `1.2.0-beta.435` -> `1.2.0-beta.507` |

---

### Release Notes

<details>
<summary>DotNetAnalyzers/StyleCopAnalyzers</summary>

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

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

#### What's Changed

- Update to StyleCop.Analyzers 1.2.0-beta.435 by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3499](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3499)
- Add c# 11 test project to opencover-report.ps1 by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3506](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3506)
- Use GetText instead of ToFullString by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3514](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3514)
- Keep tracked nodes in a list by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3525](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3525)
- Remove unnecessary nullable directives by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3530](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3530)
- Remove hard-coded language versions in test projects for c# 8, 9 and
10 by [@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3528](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3528)
- Update SA1515 to not let one range of trivia affect another by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3529](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3529)
- Mentioned VS 2022 by
[@&#8203;twojnarowski](https://github.com/twojnarowski) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3549](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3549)
- Remove byte order mark from schema file by
[@&#8203;martincostello](https://github.com/martincostello) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3562](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3562)
- Update SA1012 to expect no space between a property pattern's opening
brace and an enclosing list pattern's opening bracket by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3511](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3511)
- Update Microsoft.CodeAnalysis.CSharp.Workspaces to version 4.4.0 for
the c# 11 test project by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3580](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3580)
- Update SA1008 to handle positional patterns inside property patterns
by [@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3579](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3579)
- Update SA1000 to trigger after keywords is, or, and, not by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3585](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3585)
- Update SA1000.md by
[@&#8203;Youssef1313](https://github.com/Youssef1313) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3563](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3563)
- Update SA1313 to also allow incorrect names in explicitly implemented
methods from interfaces by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3569](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3569)
- Update SA1023 to not trigger first in line, inside a foreach without
braces by [@&#8203;bjornhellander](https://github.com/bjornhellander)
in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3543](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3543)
- Update SA1400 to recognize access modifier "file" by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3590](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3590)
- Update SA1206 to recognize modifier "file" by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3591](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3591)
- Update SA1000 to handle checked operator declarations correctly by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3505](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3505)
- Update SA1402 to handle records and record structs by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3570](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3570)
- Bump Newtonsoft.Json from 12.0.3 to 13.0.2 in
/StyleCop.Analyzers/StyleCop.Analyzers.Status.Generator by
[@&#8203;dependabot](https://github.com/dependabot) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3584](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3584)
- Update to the latest version of the testing library by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3601](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3601)
- Update so that SA1600 tests will be run with the expected language
version in test projects for c# 8 and above by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3614](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3614)
- Update reading of file_header_template and
stylecop.documentation.copyrightText to allow multiple lines by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3617](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3617)
- Update SA1015 to require trailing space after an explicit generic
return type in a lambda expression by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3625](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3625)
- Update to Microsoft.CodeAnalysis.Analyzers 3.3.5-beta1.23205.2 by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3628](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3628)
- Update SA1206 to handle c# 11 modifier "required" by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3535](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3535)
- Preparations for SettingsHelper optimizations by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3635](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3635)
- Correct SA1515 to not fire on the second line of a file header by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3633](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3633)
- Update AnalyzersExtensions and SettingsHelper to use cached JsonValue
objects where possible by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3642](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3642)
- Update SA1010 to not trigger on list patterns by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3507](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3507)
- Update NamingSettings and DocumentationSettings to keep one Regex
instance instead of calling Regex.IsMatch by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3639](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3639)
- Use ResxSourceGenerator for resource generation by
[@&#8203;sharwell](https://github.com/sharwell) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3343](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3343)
- Make XmlCommentHelper faster by
[@&#8203;ninedan](https://github.com/ninedan) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3651](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3651)
- Update RenameToUpperCaseCodeFixProvider to not offer a code fix if the
identifier only consists of underscores by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3637](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3637)
- Don't emit SA1414 for interface implementations by
[@&#8203;CollinAlpert](https://github.com/CollinAlpert) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3644](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3644)
- Support file-scoped namespaces in SA1516 by
[@&#8203;JakubLinhart](https://github.com/JakubLinhart) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3513](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3513)
- Update SA1137 to also consider init accessors by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3669](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3669)
- Update SA1500 to also consider init accessors by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3670](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3670)
- Update SA1513 to not trigger before an init accessor by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3666](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3666)
- Update SA1212 to also trigger for an init accessor before a getter by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3661](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3661)
- Update SA1513 codefix to use the existing newline character sequence
by [@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3607](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3607)
- Correct code fix for SA1130 when delegate expression is part of a cast
expression by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3516](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3516)
- Update so that c# 7 tests will be run with the expected language
version in test projects for c# 8 and above by
[@&#8203;bjornhellander](https://github.com/bjornhellander) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3616](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3616)
- SA1629 should allow full-sentence links instead of forcing the period
to glow white by [@&#8203;jnm2](https://github.com/jnm2) in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3371](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3371)

#### New Contributors

- [@&#8203;twojnarowski](https://github.com/twojnarowski) made their
first contribution in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3549](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3549)
- [@&#8203;ninedan](https://github.com/ninedan) made their first
contribution in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3651](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3651)
- [@&#8203;CollinAlpert](https://github.com/CollinAlpert) made their
first contribution in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3644](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3644)
- [@&#8203;JakubLinhart](https://github.com/JakubLinhart) made their
first contribution in
[https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3513](https://github.com/DotNetAnalyzers/StyleCopAnalyzers/pull/3513)

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

</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:eyJjcmVhdGVkSW5WZXIiOiIzNS4xMzEuMCIsInVwZGF0ZWRJblZlciI6IjM1LjEzMS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Thorsten Sauter <Thorsten.Sauter@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing SA1212 on init accessor
2 participants