Skip to content

Commit 7b80c1d

Browse files
authored
fix local build issues (#619)
1 parent d555e4d commit 7b80c1d

File tree

3 files changed

+37
-16
lines changed

3 files changed

+37
-16
lines changed

.editorconfig

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,35 +29,41 @@ indent_size = 4
2929
end_of_line = crlf
3030
trim_trailing_whitespace = true
3131

32-
dotnet_analyzer_diagnostic.category-Style.severity = error
32+
# Do not ever set to error, or these cause build failures during development.
33+
dotnet_analyzer_diagnostic.category-Style.severity = warning
3334

3435
# Organize usings
3536
dotnet_sort_system_directives_first = true
3637
dotnet_separate_import_directive_groups = false
3738

3839
file_header_template = Copyright (c) Microsoft Corporation.\nLicensed under the MIT License.
3940

40-
dotnet_diagnostic.IDE0003.severity = error # this and Me preferences
41-
dotnet_diagnostic.IDE0007.severity = error # Use 'var' instead of explicit type
42-
dotnet_diagnostic.IDE0005.severity = error # Remove unnecessary using directives
41+
dotnet_diagnostic.IDE0003.severity = warning # this and Me preferences
42+
dotnet_diagnostic.IDE0007.severity = warning # Use 'var' instead of explicit type
43+
dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives
4344
dotnet_diagnostic.IDE0010.severity = none # Add missing cases to switch statement
4445
dotnet_diagnostic.IDE0011.severity = none # Add braces
4546
dotnet_diagnostic.IDE0028.severity = none # Use collection initializers or expressions
4647
dotnet_diagnostic.IDE0042.severity = none # Deconstruct variable declaration
48+
dotnet_diagnostic.IDE0043.severity = warning
4749
dotnet_diagnostic.IDE0045.severity = none # Use conditional expression for assignment
4850
dotnet_diagnostic.IDE0046.severity = none # Use conditional expression for return
49-
dotnet_diagnostic.IDE0055.severity = error # Formatting rule
51+
dotnet_diagnostic.IDE0051.severity = warning
52+
dotnet_diagnostic.IDE0052.severity = warning
53+
dotnet_diagnostic.IDE0055.severity = warning # Formatting rule
5054
dotnet_diagnostic.IDE0057.severity = none # Use range operator
5155
dotnet_diagnostic.IDE0058.severity = none # Remove unnecessary expression value
5256
dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter
57+
dotnet_diagnostic.IDE0061.severity = none
5358
dotnet_diagnostic.IDE0063.severity = none # Use simple 'using' statement
5459
dotnet_diagnostic.IDE0066.severity = none # Use switch expression
60+
dotnet_diagnostic.IDE0064.severity = warning
5561
dotnet_diagnostic.IDE0070.severity = none # Use 'System.HashCode.Combine'
56-
dotnet_diagnostic.IDE0073.severity = error # Require file header
62+
dotnet_diagnostic.IDE0073.severity = warning # Require file header
5763
dotnet_diagnostic.IDE0078.severity = none # Use pattern matching
58-
dotnet_diagnostic.IDE0090.severity = error # expression can be simplified
64+
dotnet_diagnostic.IDE0090.severity = warning # expression can be simplified
5965
dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure
60-
dotnet_diagnostic.IDE0161.severity = error # Namespace declaration preferences
66+
dotnet_diagnostic.IDE0161.severity = warning # Namespace declaration preferences
6167
dotnet_diagnostic.IDE0210.severity = none # Convert to top-level statements
6268
dotnet_diagnostic.IDE1006.severity = none # These words must begin with upper case characters
6369

@@ -565,10 +571,6 @@ csharp_style_expression_bodied_local_functions = false:silent
565571
csharp_style_var_elsewhere = true:error
566572
csharp_style_var_when_type_is_apparent = true:error
567573
csharp_style_var_for_built_in_types = true:error
568-
dotnet_diagnostic.IDE0051.severity = error
569-
dotnet_diagnostic.IDE0052.severity = error
570-
dotnet_diagnostic.IDE0064.severity = error
571-
dotnet_diagnostic.IDE0043.severity = error
572574
dotnet_diagnostic.CA1507.severity = error
573575
csharp_space_around_binary_operators = before_and_after
574576
csharp_style_throw_expression = true:suggestion
@@ -601,4 +603,3 @@ csharp_style_prefer_not_pattern = true:suggestion
601603
csharp_style_prefer_extended_property_pattern = true:suggestion
602604
dotnet_diagnostic.CA1802.severity = error
603605
dotnet_diagnostic.CA1805.severity = error
604-
dotnet_diagnostic.IDE0061.severity = none

nuget.config

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<clear />
5+
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
6+
</packageSources>
7+
<!--
8+
When CentralPackageManagement is enabled, the packageSourceMapping element helps to remove NU1507 errors.
9+
See: https://learn.microsoft.com/en-us/nuget/consume-packages/package-source-mapping#enable-by-manually-editing-nugetconfig
10+
-->
11+
<packageSourceMapping>
12+
<!-- key value for <packageSource> should match key values from <packageSources> element -->
13+
<packageSource key="nuget">
14+
<package pattern="*" />
15+
</packageSource>
16+
</packageSourceMapping>
17+
</configuration>

src/Directory.Build.props

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
<PropertyGroup>
55
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
66
<TargetFramework>$(TargetFrameworkVersion)</TargetFramework>
7-
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
8-
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
9-
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
107
<GenerateDocumentationFile>True</GenerateDocumentationFile>
118
<NoWarn>1591</NoWarn>
129
<ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
1310
</PropertyGroup>
1411

12+
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' != 'true'">
13+
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
14+
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
15+
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
16+
</PropertyGroup>
17+
1518
<ItemGroup>
1619
<Compile Include="..\..\.version\PipelineAssemblyInfo.cs">
1720
<Link>Properties\PipelineAssemblyInfo.cs</Link>

0 commit comments

Comments
 (0)