Skip to content

Commit 08e5930

Browse files
Add linting rule (#571)
* add linting rule * remove unused package * fix format issue & enforce format check * fix format issue * fix format issue * add directory props * merge * update
1 parent 0a43988 commit 08e5930

File tree

52 files changed

+404
-337
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+404
-337
lines changed

.editorconfig

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# editorconfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
## Default settings ##
7+
[*]
8+
insert_final_newline = true
9+
indent_style = space
10+
indent_size = 4
11+
trim_trailing_whitespace = true
12+
13+
## Formatting rule ##
14+
# https://learn.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0055
15+
dotnet_diagnostic.IDE0055.severity = error
16+
17+
# 'Using' directive preferences
18+
dotnet_sort_system_directives_first = false
19+
20+
# New line preferences
21+
dotnet_diagnostic.IDE2002.severity = error
22+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = false
23+
dotnet_diagnostic.IDE2004.severity = error
24+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = false
25+
dotnet_diagnostic.IDE2005.severity = error
26+
csharp_style_allow_blank_line_after_token_in_conditional_expression_experimental = false
27+
dotnet_diagnostic.IDE2006.severity = error
28+
csharp_style_allow_blank_line_after_token_in_arrow_expression_clause_experimental = false
29+
dotnet_diagnostic.IDE2000.severity = error
30+
dotnet_style_allow_multiple_blank_lines_experimental = false
31+
dotnet_diagnostic.IDE2003.severity = error
32+
dotnet_style_allow_statement_immediately_after_block_experimental = false
33+
34+
[*.csproj]
35+
indent_size = 2
36+
charset = utf-8
37+
38+
[*.json]
39+
indent_size = 2

Directory.Build.props

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<EnforceCodeStyleInBuild>True</EnforceCodeStyleInBuild>
5+
</PropertyGroup>
6+
7+
</Project>
Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
1-
<Project Sdk="Microsoft.NET.Sdk.Web">
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
23
<PropertyGroup>
34
<IsPackable>false</IsPackable>
45
<TargetFramework>net8.0</TargetFramework>
56
</PropertyGroup>
7+
68
<ItemGroup>
79
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="2.0.2" />
810
</ItemGroup>
11+
912
<ItemGroup>
1013
<ProjectReference Include="..\..\src\Microsoft.Azure.AppConfiguration.AspNetCore\Microsoft.Azure.AppConfiguration.AspNetCore.csproj" />
1114
</ItemGroup>
15+
1216
<ItemGroup>
1317
<Content Update="appsettings.json">
1418
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
1519
</Content>
1620
</ItemGroup>
21+
1722
</Project>

examples/ConfigStoreDemo/Pages/About.cshtml.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33
//
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Threading.Tasks;
84
using Microsoft.AspNetCore.Mvc.RazorPages;
95

106
namespace Microsoft.Extensions.Configuration.AzureAppConfiguration.Examples.ConfigStoreDemo.Pages

examples/ConfigStoreDemo/Pages/Contact.cshtml.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33
//
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Linq;
7-
using System.Threading.Tasks;
84
using Microsoft.AspNetCore.Mvc.RazorPages;
95

106
namespace Microsoft.Extensions.Configuration.AzureAppConfiguration.Examples.ConfigStoreDemo.Pages

examples/ConfigStoreDemo/Pages/Error.cshtml.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
// Copyright (c) Microsoft Corporation.
22
// Licensed under the MIT license.
33
//
4-
using System;
5-
using System.Collections.Generic;
6-
using System.Diagnostics;
7-
using System.Linq;
8-
using System.Threading.Tasks;
94
using Microsoft.AspNetCore.Mvc.RazorPages;
5+
using System.Diagnostics;
106

117
namespace Microsoft.Extensions.Configuration.AzureAppConfiguration.Examples.ConfigStoreDemo.Pages
128
{

examples/ConsoleApplication/ConsoleApplication.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<IsPackable>false</IsPackable>

src/Microsoft.Azure.AppConfiguration.AspNetCore/Microsoft.Azure.AppConfiguration.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\build\NugetProperties.props" />
33

44
<PropertyGroup>

src/Microsoft.Azure.AppConfiguration.Functions.Worker/Microsoft.Azure.AppConfiguration.Functions.Worker.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22
<Import Project="..\..\build\NugetProperties.props" />
33

44
<PropertyGroup>

src/Microsoft.Extensions.Configuration.AzureAppConfiguration/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@
3030
"c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654" +
3131
"753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46" +
3232
"ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484c" +
33-
"f7045cc7")]
33+
"f7045cc7")]

0 commit comments

Comments
 (0)