Skip to content

Commit

Permalink
Add editorconfig to all projects
Browse files Browse the repository at this point in the history
  • Loading branch information
FrediKats committed Sep 3, 2023
1 parent b444aef commit 140e005
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Kysect.Editorconfig" Version="1.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Kysect.Editorconfig" Version="1.0.4" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="7.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
Expand Down
2 changes: 1 addition & 1 deletion Sources/Kysect.Configuin.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ IServiceProvider InitializeServiceProvider()
HostApplicationBuilder builder = Host.CreateApplicationBuilder();
builder.Configuration.AddJsonFile("appsettings.json");

var serviceCollection = builder.Services;
IServiceCollection serviceCollection = builder.Services;

serviceCollection.AddOptionsWithValidation<ConfiguinConfiguration>(nameof(ConfiguinConfiguration));

Expand Down
9 changes: 9 additions & 0 deletions Sources/Kysect.Configuin.Tests/Kysect.Configuin.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,17 @@
<IsTestProject>true</IsTestProject>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>$(NoWarn);CS1591;CA1707</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<NoWarn>$(NoWarn);CS1591;CA1707</NoWarn>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="FluentAssertions" Version="6.12.0" />
<PackageReference Include="Kysect.Editorconfig" Version="1.0.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.7.2" />
<PackageReference Include="NUnit" Version="3.13.3" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class MarkdownDocumentParserTests
[Test]
public void SplitByHeaders_DocumentWithThreeHeaders_ReturnThreeParts()
{
var input = """
string input = """
## When to suppress warnings

It is safe to suppress violations from this rule if the design and performance benefits from implementing the interface are not critical.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class MarkdownTableParserTests
[Test]
public void ParseToSimpleContent_ForSimpleTable_ReturnExpectedResult()
{
var input = """
string input = """
| | Value |
|-------------------------------------|------------------------------|
| **Rule ID** | CA1000 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void ParseStyleRule_IDE0040_ReturnExpectedResult()
[Test]
public void ParseStyleRule_IDE0003_0009_ReturnExpectedResult()
{
string fileText = GetIdeDescription( "ide0003-ide0009.md");
string fileText = GetIdeDescription("ide0003-ide0009.md");

var options = new RoslynStyleRuleOption[]
{
Expand Down Expand Up @@ -171,7 +171,7 @@ public void Parse_DotnetFormattingOptions_ReturnExpectedResult()

var dotnet_sort_system_directives_first = new RoslynStyleRuleOption(
"dotnet_sort_system_directives_first",
new []
new[]
{
new RoslynStyleRuleOptionValue("true", "Sort System.* using directives alphabetically, and place them before other using directives."),
new RoslynStyleRuleOptionValue("false", "Do not place System.* using directives before other using directives.")
Expand Down Expand Up @@ -223,7 +223,7 @@ public void Parse_CsharpFormattingOptions_ReturnExpectedResult()
string fileContent = File.ReadAllText(pathToFile);
var csharp_new_line_before_open_brace = new RoslynStyleRuleOption(
"csharp_new_line_before_open_brace",
new []
new[]
{
new RoslynStyleRuleOptionValue("all", "Require braces to be on a new line for all expressions (\"Allman\" style)."),
new RoslynStyleRuleOptionValue("none", "Require braces to be on the same line for all expressions (\"K&R\")."),
Expand Down Expand Up @@ -289,7 +289,7 @@ public void Parse_CodeStyleRefactoringOptions_ReturnExpectedResult()
[Ignore("Need to fix all related problems")]
public void Parse_MsDocsRepository_FinishWithoutError()
{
var repositoryPathProvider = TestImplementations.CreateDocumentationInfoLocalProvider();
MsLearnDocumentationInfoLocalProvider repositoryPathProvider = TestImplementations.CreateDocumentationInfoLocalProvider();

MsLearnDocumentationRawInfo msLearnDocumentationRawInfo = repositoryPathProvider.Provide();
RoslynRules roslynRules = _parser.Parse(msLearnDocumentationRawInfo);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class MsLearnTableParserTests
[Test]
public void Parse_KeyValueTable_ReturnExpectedResult()
{
var input = """
string input = """
| | Value |
|-------------------------------------|------------------------------|
| **Rule ID** | CA1000 |
Expand All @@ -46,7 +46,7 @@ public void Parse_KeyValueTable_ReturnExpectedResult()
[Test]
public void Parse_KeyMultiValueTableContent_ReturnExpectedResult()
{
var input = """
string input = """
| Property | Value |
| ------------------------ | ----------------------------------------------------------------- |
| **Rule ID** | IDE0058 |
Expand Down Expand Up @@ -82,7 +82,7 @@ public void Parse_KeyMultiValueTableContent_ReturnExpectedResult()
[Test]
public void Parse_PropertyValueWithDescriptionTable_ReturnExpectedResult()
{
var input = """
string input = """
| Property | Value | Description |
| ------------------------ | ---------------------------------------------------------------- | -------------------------------- |
| **Option name** | dotnet_style_prefer_is_null_check_over_reference_equality_method | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ public static class WellKnownRoslynRuleDefinitions
{
public static RoslynStyleRule IDE0040()
{
var codeSample = """
string codeSample = """
// dotnet_style_require_accessibility_modifiers = always
// dotnet_style_require_accessibility_modifiers = for_non_interface_members
class MyClass
Expand Down

0 comments on commit 140e005

Please sign in to comment.