Skip to content

Commit

Permalink
Enable analyzers and add a editorconfig (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
Barsonax authored Oct 17, 2023
1 parent fc902e4 commit 00e7172
Show file tree
Hide file tree
Showing 9 changed files with 73 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
root = true

[*]
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
max_line_length = 190

# Xml project files
[*.csproj]
indent_style = space
indent_size = 2

# Xml config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
indent_style = space
indent_size = 2

[*.{md,json}]
indent_style = space
indent_size = 4

[*.cs]
indent_style = space
indent_size = 4

# Dispose objects before losing scope
dotnet_diagnostic.CA2000.severity = none
# Do not directly await a Task
dotnet_diagnostic.CA2007.severity = none
# Use the LoggerMessage delegates
dotnet_diagnostic.CA1848.severity = none
# Validate arguments of public methods
dotnet_diagnostic.CA1062.severity = none
# Do not pass literals as localized parameters
dotnet_diagnostic.CA1303.severity = none
# Do not catch general exception types
dotnet_diagnostic.CA1031.severity = none
#Do not expose generic lists
dotnet_diagnostic.CA1002.severity = none
# Identifiers should not contain underscores
dotnet_diagnostic.CA1707.severity = none
# Avoid uninstantiated internal classes
dotnet_diagnostic.CA1812.severity = none
11 changes: 11 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project>
<PropertyGroup>
<LangVersion>11.0</LangVersion>
</PropertyGroup>

<PropertyGroup>
<EnableNETAnalyzers>true</EnableNETAnalyzers>
<AnalysisLevel>latest</AnalysisLevel>
<AnalysisMode>All</AnalysisMode>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions NetDaemon.sln
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyLibrary", "src\debug\MyLi
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyNDApp", "src\debug\MyNDApp\MyNDApp.csproj", "{FEE1EA29-4609-4200-A92C-C61ECB7A3D0B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0710DAED-70D8-49B5-AA1E-B4494F4C6599}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down
2 changes: 2 additions & 0 deletions src/AppModel/NetDaemon.AppModel.Tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.xUnit1030.severity = none
2 changes: 2 additions & 0 deletions src/Client/NetDaemon.HassClient.Tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.xUnit1030.severity = none
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.xUnit1030.severity = none
2 changes: 2 additions & 0 deletions src/HassModel/NetDaemon.HassModel.Tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.xUnit1030.severity = none
2 changes: 2 additions & 0 deletions src/Runtime/NetDaemon.Runtime.Tests/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.xUnit1030.severity = none
2 changes: 2 additions & 0 deletions tests/Integration/NetDaemon.Tests.Integration/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[*.cs]
dotnet_diagnostic.xUnit1030.severity = none

0 comments on commit 00e7172

Please sign in to comment.