Azure / AppConfiguration-DotnetProvider

The .NET Standard configuration provider for Azure App Configuration
https://github.com/Azure/AppConfiguration
MIT License
83 stars 37 forks source link

Add linting rule #571

Closed zhiyuanliang-ms closed 2 months ago

zhiyuanliang-ms commented 2 months ago

Why this PR?

Add code format check

Visible changes

Linting rules are defined in .editorconfig file.

property is added to the csproj file and then all code format issues will be reported during build process. In the editorconfig file, it sets the severity of IDE0055 and some other formating rules to error. This will make build fail if the formating rule is not followed.
juniwang commented 2 months ago

what's the purpose of this file: https://github.com/Azure/AppConfiguration-DotnetProvider/blob/main/AzureAppConfigurationRules.ruleset ?

zhiyuanliang-ms commented 2 months ago

what's the purpose of this file: https://github.com/Azure/AppConfiguration-DotnetProvider/blob/main/AzureAppConfigurationRules.ruleset ?

@juniwang This file is used for enforce CA2007 check. #410

Code analysis is a big topic. It includes two aspects: code quality and code style.

image

CA2007 belongs to code quality check.

Even for code style, there are 4 aspects as shown in the screenshot below.

image

In this PR, we only focus on the formatting rules.

juniwang commented 2 months ago

what's the purpose of this file: https://github.com/Azure/AppConfiguration-DotnetProvider/blob/main/AzureAppConfigurationRules.ruleset ?

@juniwang This file is used for enforce CA2007 check. #410

Code analysis is a big topic. It includes two aspects: code quality and code style.

image

CA2007 belongs to code quality check.

Even for code style, there are 4 aspects as shown in the screenshot below.

image

In this PR, we only focus on the formatting rules.

OK,