Skip to content

Commit a689c16

Browse files
committed
chore: Upgrade SA
1 parent 3f1ca07 commit a689c16

17 files changed

+26
-27
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<!-- Shared code analyzers used for all projects in the solution -->
77
<ItemGroup Condition="!$(MSBuildProjectName.EndsWith('samples'))">
88
<GlobalPackageReference Include="AsyncFixer" Version="1.6.0" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers"/>
9-
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="9.32.0.97167" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers"/>
9+
<GlobalPackageReference Include="SonarAnalyzer.CSharp" Version="10.5.0.109200" PrivateAssets="All" IncludeAssets="Runtime;Build;Native;contentFiles;Analyzers"/>
1010
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
1111
<PackageVersion Include="Meziantou.Polyfill" Version="1.0.42" />
1212
</ItemGroup>
@@ -28,7 +28,7 @@
2828

2929
<ItemGroup Label="System.Text.Json Vulnerability">
3030
<!-- Due to a CVE in System.Text.Json we explicitly reference the latest version of System.Text.Json -->
31-
<PackageVersion Include="System.Text.Json" Version="9.0.0"/>
31+
<PackageVersion Include="System.Text.Json" Version="9.0.1"/>
3232
</ItemGroup>
3333

3434
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">

tests/bunit.core.tests/Rendering/RenderModeTests.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
</ComponentWithChildContent>
169169
</ComponentWithChildContent>);
170170

171-
act.ShouldThrow<RenderModeMisMatchException>(); // todo: figure out good exception to use
171+
act.ShouldThrow<RenderModeMisMatchException>();
172172
}
173173
}
174174
@code{

tests/bunit.core.tests/TestDoubles/PersistentComponentState/FakePersistentComponentStateTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public void Test013(string key)
6767
{
6868
var fakeState = this.AddFakePersistentComponentState();
6969

70-
fakeState.TryTake<string>(key, out var actual).ShouldBeFalse();
70+
fakeState.TryTake<string>(key, out _).ShouldBeFalse();
7171
}
7272

7373
[Fact(DisplayName = "TriggerOnPersisting triggers OnPersisting callbacks added to store")]

tests/bunit.testassets/BlazorE2E/AddRemoveChildComponents.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Child components follow.
1010

1111
@code {
1212
int numAdded = 0;
13-
List<string> currentChildrenMessages = new List<string>();
13+
private readonly List<string> currentChildrenMessages = new List<string>();
1414

1515
void AddChild()
1616
{
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div id="cool_beans" data-tab="@TabId">@TabId</div>
22

33
@code {
4-
string TabId = "17";
4+
private readonly string TabId = "17";
55
}

tests/bunit.testassets/BlazorE2E/DuplicateAttributesComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</div>
1414

1515
@functions {
16-
Dictionary<string, object> elementValues = new Dictionary<string, object>
16+
private readonly Dictionary<string, object> elementValues = new Dictionary<string, object>
1717
{
1818
{ "bool", true },
1919
{ "string", "middle-value" },

tests/bunit.testassets/BlazorE2E/KeyPressEventComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Type here: <input @onkeypress=OnKeyPressed />
99
</ul>
1010

1111
@code {
12-
List<string> keysPressed = new List<string>();
12+
private readonly List<string> keysPressed = new List<string>();
1313

1414
void OnKeyPressed(KeyboardEventArgs eventArgs)
1515
{

tests/bunit.testassets/BlazorE2E/MarkupBlockComponent.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#nullable disable
2929
bool changeOutput;
3030

31-
string myMarkup = "<p class='markup-string-value'>This is a <em>markup string</em>.</p>";
31+
private readonly string myMarkup = "<p class='markup-string-value'>This is a <em>markup string</em>.</p>";
3232

3333
void EmitMarkupBlock(RenderTreeBuilder builder)
3434
{

tests/bunit.testassets/BlazorE2E/MovingCheckboxesComponent.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141

4242
@code {
4343
#nullable disable
44-
List<TodoItem> items = new List<TodoItem>
44+
private readonly List<TodoItem> items = new List<TodoItem>
4545
{
4646
new TodoItem { Text = "Alpha" },
4747
new TodoItem { Text = "Beta" },
4848
new TodoItem { Text = "Gamma", IsDone = true },
4949
new TodoItem { Text = "Delta", IsDone = true },
5050
};
5151

52-
class TodoItem
52+
private sealed class TodoItem
5353
{
5454
public bool IsDone { get; set; }
5555
public string Text { get; set; }

tests/bunit.testassets/BlazorE2E/OrderedList.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77
@foreach (var item in Items)
88
{
9-
@Template(new Context { Index = index++, Item = item, });
9+
@Template(new Context { Index = index++, Item = item, })
1010
}
1111
</ol>
1212

0 commit comments

Comments
 (0)