Skip to content

Commit de9ef24

Browse files
authored
Update SonarAnalyzer.CSharp to version 9.20 (#27)
1 parent 551d092 commit de9ef24

5 files changed

Lines changed: 56 additions & 4 deletions

File tree

.github/workflows/cd-production.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,10 @@ jobs:
3737
notify:
3838
needs: [pack-and-publish]
3939
runs-on: ubuntu-latest
40-
if: ${{ !contains(github.event.release.tag_name, '-alpha.') }}
4140
steps:
42-
- uses: neolution-ch/action-release-notifier@v1
41+
- uses: neolution-ch/action-release-notifier@v1.3.0
4342
with:
4443
slack-token: ${{ secrets.SLACK_RELEASE_NOTIFIER_TOKEN }}
4544
slack-channel-ids: ${{ vars.SLACK_CHANNEL_ID_RELEASE_ANNOUNCEMENTS }}
45+
ignore-alpha-releases: true
46+
ignore-rc-releases: true

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,41 @@ and adheres to a project-specific [Versioning](/README.md).
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- S2925: "Thread.Sleep" should not be used in tests
13+
- S3363: Date and time should not be used as a type for primary keys
14+
- S6561: Avoid using "DateTime.Now" for benchmarking or timing operations
15+
- S6562: Always set the "DateTimeKind" when creating new "DateTime" instances
16+
- S6575: Use "TimeZoneInfo.FindSystemTimeZoneById" without converting the timezones with "TimezoneConverter"
17+
- S6580: Use a format provider when parsing date and time
18+
- S6588: Use the "UnixEpoch" field instead of creating "DateTime" instances that point to the beginning of the Unix epoch
19+
- S6607: The collection should be filtered before sorting by using "Where" before "OrderBy"
20+
- S6609: "Min/Max" properties of "Set" types should be used instead of the "Enumerable" extension methods
21+
- S6610: "StartsWith" and "EndsWith" overloads that take a "char" should be used instead of the ones that take a "string"
22+
- S6612: The lambda parameter should be used instead of capturing arguments in "ConcurrentDictionary" methods
23+
- S6613: "First" and "Last" properties of "LinkedList" should be used instead of the "First()" and "Last()" extension methods
24+
- S6617: "Contains" should be used instead of "Any" for simple equality checks
25+
- S6618: "string.Create" should be used instead of "FormattableString"
26+
- S6640: Using unsafe code blocks is security-sensitive
27+
- S6797: Blazor query parameter type should be supported
28+
- S6798: [JSInvokable] attribute should only be used on public methods
29+
- S6800: Component parameter type should match the route parameter type constraint
30+
- S6803: Parameters with SupplyParameterFromQuery attribute should be used only in routable components
31+
32+
### Removed
33+
34+
- S2228: Console logging should not be used
35+
- S2255: Writing cookies is security-sensitive
36+
- S3884: "CoSetProxyBlanket" and "CoInitializeSecurity" should not be used
37+
- S4564: ASP.NET HTTP request validation feature should not be disabled
38+
- S4784: Using regular expressions is security-sensitive
39+
- S4787: Encrypting data is security-sensitive
40+
- S4818: Using Sockets is security-sensitive
41+
- S4823: Using command line arguments is security-sensitive
42+
- S4829: Reading the Standard Input is security-sensitive
43+
- S4834: Controlling permissions is security-sensitive
44+
1045
## [3.1.2] - 2024-10-03
1146

1247
### Removed

Neolution.CodeAnalysis.TestsRuleset.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<developmentDependency>true</developmentDependency>
1414
<dependencies>
1515
<dependency id="StyleCop.Analyzers.Unstable" version="1.2.0.556" />
16-
<dependency id="SonarAnalyzer.CSharp" version="8.56.0.67649" />
16+
<dependency id="SonarAnalyzer.CSharp" version="9.20.0.85982" />
1717
</dependencies>
1818
</metadata>
1919
<files>

Neolution.CodeAnalysis.nuspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<developmentDependency>true</developmentDependency>
1414
<dependencies>
1515
<dependency id="StyleCop.Analyzers.Unstable" version="1.2.0.556" />
16-
<dependency id="SonarAnalyzer.CSharp" version="8.56.0.67649" />
16+
<dependency id="SonarAnalyzer.CSharp" version="9.20.0.85982" />
1717
</dependencies>
1818
</metadata>
1919
<files>

build/Neolution.CodeAnalysis.globalconfig

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,22 @@ dotnet_diagnostic.CA2000.severity = warning
254254
; Deprecated code should eventually be removed, but it should not break the current build.
255255
dotnet_diagnostic.S1133.severity = suggestion
256256

257+
# S6602: "Find" method should be used instead of the "FirstOrDefault" extension
258+
; It seems like the potential performance gains here will be negative after .NET9: https://github.com/SonarSource/sonar-dotnet/issues/9664
259+
dotnet_diagnostic.S6602.severity = none
260+
261+
# S6603: The collection-specific "TrueForAll" method should be used instead of the "All" extension
262+
; Only has a performance gain with "large" collections and has a slightly different syntax when used with Arrays which could lead to confusion.
263+
dotnet_diagnostic.S6603.severity = none
264+
265+
# S6605: Collection-specific "Exists" method should be used instead of the "Any" extension
266+
; It seems like the potential performance gains here will be negative after .NET9: https://github.com/SonarSource/sonar-dotnet/issues/9665
267+
dotnet_diagnostic.S6605.severity = none
268+
269+
# S6608: Prefer indexing instead of "Enumerable" methods on types implementing "IList"
270+
; Better readability of `First()` and `Last()` are preferred over performance gains
271+
dotnet_diagnostic.S6608.severity = none
272+
257273
# S107: Methods should not have too many parameters
258274
dotnet_diagnostic.S107.severity = warning
259275

0 commit comments

Comments
 (0)