Skip to content

Commit 3561573

Browse files
committed
Make CA1304 & CA1305 warnings
1 parent 6d69c9b commit 3561573

28 files changed

Lines changed: 125 additions & 49 deletions

File tree

.editorconfig

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ dotnet_naming_symbols.any_async_methods.applicable_kinds = method
7171
dotnet_naming_symbols.any_async_methods.applicable_accessibilities = *
7272
dotnet_naming_symbols.any_async_methods.required_modifiers = async
7373

74-
dotnet_naming_style.end_in_async.required_prefix =
74+
dotnet_naming_style.end_in_async.required_prefix =
7575
dotnet_naming_style.end_in_async.required_suffix = Async
7676
dotnet_naming_style.end_in_async.capitalization = pascal_case
77-
dotnet_naming_style.end_in_async.word_separator =
77+
dotnet_naming_style.end_in_async.word_separator =
7878

7979
# Obsolete warnings, this should be removed or changed to warning once we address some of the obsolete items.
8080
dotnet_diagnostic.CS0618.severity = suggestion
@@ -85,6 +85,12 @@ dotnet_diagnostic.CS0612.severity = suggestion
8585
# Remove unnecessary using directives https://docs.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0005
8686
dotnet_diagnostic.IDE0005.severity = warning
8787

88+
# Specify CultureInfo https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1304
89+
dotnet_diagnostic.CA1304.severity = warning
90+
91+
# Specify IFormatProvider https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/quality-rules/ca1305
92+
dotnet_diagnostic.CA1305.severity = warning
93+
8894
# CSharp code style settings:
8995
[*.cs]
9096
# Prefer "var" everywhere

Directory.Build.props

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@
1313
<TreatWarningsAsErrors Condition="'$(TreatWarningsAsErrors)' == ''">true</TreatWarningsAsErrors>
1414
</PropertyGroup>
1515

16-
16+
1717
<PropertyGroup>
18-
18+
1919
<MicrosoftNetTestSdkVersion>18.0.1</MicrosoftNetTestSdkVersion>
20-
20+
2121
<XUnitVersion>2.6.6</XUnitVersion>
22-
22+
2323
<XUnitRunnerVisualStudioVersion>2.5.6</XUnitRunnerVisualStudioVersion>
24-
24+
2525
<CoverletCollectorVersion>6.0.0</CoverletCollectorVersion>
26-
26+
2727
<NSubstituteVersion>5.1.0</NSubstituteVersion>
28-
28+
2929
<AutoFixtureXUnit2Version>4.18.1</AutoFixtureXUnit2Version>
30-
30+
3131
<AutoFixtureAutoNSubstituteVersion>4.18.1</AutoFixtureAutoNSubstituteVersion>
3232
</PropertyGroup>
33-
</Project>
33+
</Project>
Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
2-
3-
<PropertyGroup>
4-
<IsPackable>false</IsPackable>
5-
</PropertyGroup>
6-
7-
<ItemGroup>
8-
<PackageReference Include="coverlet.collector" Version="$(CoverletCollectorVersion)">
9-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
10-
<PrivateAssets>all</PrivateAssets>
11-
</PackageReference>
12-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.10" />
13-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNetTestSdkVersion)" />
14-
<PackageReference Include="NSubstitute" Version="$(NSubstituteVersion)" />
15-
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
16-
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioVersion)">
17-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
18-
<PrivateAssets>all</PrivateAssets>
19-
</PackageReference>
20-
<PackageReference Include="AutoFixture.Xunit2" Version="$(AutoFixtureXUnit2Version)" />
21-
</ItemGroup>
22-
23-
<ItemGroup>
24-
<ProjectReference Include="..\..\src\Scim\Scim.csproj" />
25-
<ProjectReference Include="..\..\..\test\Common\Common.csproj" />
26-
<ProjectReference Include="..\..\..\test\IntegrationTestCommon\IntegrationTestCommon.csproj" />
27-
</ItemGroup>
28-
<ItemGroup>
29-
<Content Update="Properties\launchSettings.json">
30-
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
31-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
32-
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
33-
</Content>
34-
</ItemGroup>
35-
</Project>
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<IsPackable>false</IsPackable>
5+
<!-- These opt outs should be removed when all warnings are addressed -->
6+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1305</WarningsNotAsErrors>
7+
</PropertyGroup>
8+
9+
<ItemGroup>
10+
<PackageReference Include="coverlet.collector" Version="$(CoverletCollectorVersion)">
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
<PrivateAssets>all</PrivateAssets>
13+
</PackageReference>
14+
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="8.0.10" />
15+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNetTestSdkVersion)" />
16+
<PackageReference Include="NSubstitute" Version="$(NSubstituteVersion)" />
17+
<PackageReference Include="xunit" Version="$(XUnitVersion)" />
18+
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioVersion)">
19+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
20+
<PrivateAssets>all</PrivateAssets>
21+
</PackageReference>
22+
<PackageReference Include="AutoFixture.Xunit2" Version="$(AutoFixtureXUnit2Version)" />
23+
</ItemGroup>
24+
25+
<ItemGroup>
26+
<ProjectReference Include="..\..\src\Scim\Scim.csproj" />
27+
<ProjectReference Include="..\..\..\test\Common\Common.csproj" />
28+
<ProjectReference Include="..\..\..\test\IntegrationTestCommon\IntegrationTestCommon.csproj" />
29+
</ItemGroup>
30+
<ItemGroup>
31+
<Content Update="Properties\launchSettings.json">
32+
<ExcludeFromSingleFile>true</ExcludeFromSingleFile>
33+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
34+
<CopyToPublishDirectory>Never</CopyToPublishDirectory>
35+
</Content>
36+
</ItemGroup>
37+
</Project>

src/Admin/Admin.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
<PropertyGroup>
44
<UserSecretsId>bitwarden-Admin</UserSecretsId>
5+
<!-- These opt outs should be removed when all warnings are addressed -->
6+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1304;CA1305</WarningsNotAsErrors>
57
</PropertyGroup>
68

79
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Admin' " />

src/Api/Api.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
55
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
66
<ANCMPreConfiguredForIIS>true</ANCMPreConfiguredForIIS>
7+
<!-- These opt outs should be removed when all warnings are addressed -->
8+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1304;CA1305</WarningsNotAsErrors>
79
</PropertyGroup>
810

911
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

src/Billing/Billing.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
<PropertyGroup>
55
<UserSecretsId>bitwarden-Billing</UserSecretsId>
6+
<!-- These opt outs should be removed when all warnings are addressed -->
7+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1305</WarningsNotAsErrors>
68
</PropertyGroup>
79

810
<PropertyGroup Label="Server SDK settings">

src/Core/Core.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<GenerateUserSecretsAttribute>false</GenerateUserSecretsAttribute>
55
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
6+
<!-- These opt outs should be removed when all warnings are addressed -->
7+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1304;CA1305</WarningsNotAsErrors>
68
</PropertyGroup>
79

810
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

src/Icons/Icons.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<UserSecretsId>bitwarden-Icons</UserSecretsId>
55
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
6+
<!-- These opt outs should be removed when all warnings are addressed -->
7+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1304;CA1305</WarningsNotAsErrors>
68
</PropertyGroup>
79

810
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Icons' " />

src/Identity/Identity.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
<PropertyGroup>
44
<UserSecretsId>bitwarden-Identity</UserSecretsId>
55
<MvcRazorCompileOnPublish>false</MvcRazorCompileOnPublish>
6+
<!-- These opt outs should be removed when all warnings are addressed -->
7+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1305</WarningsNotAsErrors>
68
</PropertyGroup>
79

810
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Identity' " />

src/Infrastructure.Dapper/Infrastructure.Dapper.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

3+
<PropertyGroup>
4+
<!-- These opt outs should be removed when all warnings are addressed -->
5+
<WarningsNotAsErrors>$(WarningsNotAsErrors);CA1305</WarningsNotAsErrors>
6+
</PropertyGroup>
7+
38
<ItemGroup>
49
<ProjectReference Include="..\Core\Core.csproj" />
510
</ItemGroup>

0 commit comments

Comments
 (0)