aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJP Dillingham <jpdillingham@gmail.com>2021-02-09 08:46:25 -0600
committerJP Dillingham <jpdillingham@gmail.com>2021-02-09 08:46:25 -0600
commit287f714d93292f890b919cb0fb969ca04bed38f8 (patch)
tree0abb511a415d18036a11fede7aaaa8095b053ae5
parentaec49da74c08865353faae4d97fb4e405ae970e5 (diff)
downloadslskd-287f714d93292f890b919cb0fb969ca04bed38f8.tar.gz
add stylecop and analysis ruleset
-rw-r--r--src/slskd/Properties/analysis.ruleset47
-rw-r--r--src/slskd/Properties/launchSettings.json8
-rw-r--r--src/slskd/Properties/stylecop.json27
-rw-r--r--src/slskd/slskd.csproj56
4 files changed, 105 insertions, 33 deletions
diff --git a/src/slskd/Properties/analysis.ruleset b/src/slskd/Properties/analysis.ruleset
new file mode 100644
index 00000000..e1522031
--- /dev/null
+++ b/src/slskd/Properties/analysis.ruleset
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RuleSet Name="Soulseek.NET Ruleset" Description="Global code analysis rules for Soulseek.NET projects up for consumption" ToolsVersion="16.0">
+ <Include Path="allrules.ruleset" Action="Hidden" />
+ <Rules AnalyzerId="Microsoft.CodeQuality.Analyzers" RuleNamespace="Microsoft.CodeQuality.Analyzers">
+ <Rule Id="CA1016" Action="Warning" />
+ <Rule Id="CA1028" Action="None" />
+ <Rule Id="CA1031" Action="None" />
+ <Rule Id="CA1033" Action="Warning" />
+ <Rule Id="CA1060" Action="Warning" />
+ <Rule Id="CA1061" Action="Warning" />
+ <Rule Id="CA1063" Action="Warning" />
+ <Rule Id="CA1065" Action="Warning" />
+ <Rule Id="CA1303" Action="None" />
+ <Rule Id="CA1711" Action="None" />
+ <Rule Id="CA1714" Action="Warning" />
+ <Rule Id="CA1717" Action="Warning" />
+ <Rule Id="CA1725" Action="Warning" />
+ <Rule Id="CA1805" Action="None" />
+ <Rule Id="CA1819" Action="None" />
+ <Rule Id="CA1822" Action="None" />
+ <Rule Id="CA2007" Action="Warning" />
+ <Rule Id="CA2200" Action="Warning" />
+ <Rule Id="CA2214" Action="Warning" />
+ <Rule Id="CA2231" Action="Warning" />
+ </Rules>
+ <Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
+ <Rule Id="CA1001" Action="Warning" />
+ <Rule Id="CA1821" Action="Warning" />
+ </Rules>
+ <Rules AnalyzerId="Microsoft.NetCore.Analyzers" RuleNamespace="Microsoft.NetCore.Analyzers">
+ <Rule Id="CA2008" Action="None" />
+ </Rules>
+ <Rules AnalyzerId="SonarAnalyzer.CSharp" RuleNamespace="SonarAnalyzer.CSharp">
+ <Rule Id="S2589" Action="None" />
+ <Rule Id="S3427" Action="Info" />
+ </Rules>
+ <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
+ <Rule Id="SA1008" Action="None" />
+ <Rule Id="SA1009" Action="None" />
+ <Rule Id="SA1101" Action="None" />
+ <Rule Id="SA1124" Action="None" />
+ <Rule Id="SA1300" Action="None" />
+ <Rule Id="SA1402" Action="None" />
+ <Rule Id="SA1516" Action="None" />
+ <Rule Id="SA1600" Action="Info" />
+ </Rules>
+</RuleSet> \ No newline at end of file
diff --git a/src/slskd/Properties/launchSettings.json b/src/slskd/Properties/launchSettings.json
index f5409d71..b151b2f4 100644
--- a/src/slskd/Properties/launchSettings.json
+++ b/src/slskd/Properties/launchSettings.json
@@ -1,12 +1,4 @@
{
- "iisSettings": {
- "windowsAuthentication": false,
- "anonymousAuthentication": true,
- "iisExpress": {
- "applicationUrl": "http://localhost:57117/",
- "sslPort": 44332
- }
- },
"profiles": {
"slskd": {
"commandName": "Project",
diff --git a/src/slskd/Properties/stylecop.json b/src/slskd/Properties/stylecop.json
new file mode 100644
index 00000000..7d848f1a
--- /dev/null
+++ b/src/slskd/Properties/stylecop.json
@@ -0,0 +1,27 @@
+{
+ "$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
+ "settings": {
+ "orderingRules": {
+ "systemUsingDirectivesFirst": true,
+ "usingDirectivesPlacement": "insideNamespace"
+ },
+ "maintainabilityRules": {
+ "topLevelTypes": [
+ "class",
+ "delegate",
+ "enum",
+ "interface"
+ ]
+ },
+ "documentationRules": {
+ "documentPrivateElements": false,
+ "documentPrivateFields": false,
+ "companyName": "slskd Team",
+ "copyrightText": " Copyright (c) {companyName}. All rights reserved.\n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU Affero General Public License as published\n by the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Affero General Public License for more details.\n\n You should have received a copy of the GNU Affero General Public License\n along with this program. If not, see https://www.gnu.org/licenses/.",
+ "variables": {
+ "licenseName": "AGPLv3",
+ "licenseFile": "LICENSE"
+ }
+ }
+ }
+} \ No newline at end of file
diff --git a/src/slskd/slskd.csproj b/src/slskd/slskd.csproj
index c177f6f7..30f891a0 100644
--- a/src/slskd/slskd.csproj
+++ b/src/slskd/slskd.csproj
@@ -1,18 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
-
<PropertyGroup>
- <TargetFramework>net5.0</TargetFramework>
- <LangVersion>9.0</LangVersion>
- </PropertyGroup>
-
- <PropertyGroup>
- <ServerGarbageCollection>false</ServerGarbageCollection>
<RepositoryUrl>https://github.com/slskd/slskd</RepositoryUrl>
<PackageProjectUrl>https://slskd.org</PackageProjectUrl>
<Authors>slskd Team</Authors>
<Copyright>Copyright (c) slskd Team</Copyright>
- <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ </PropertyGroup>
+
+ <PropertyGroup>
+ <TargetFramework>net5.0</TargetFramework>
+ <LangVersion>9.0</LangVersion>
+ <CodeAnalysisRuleSet>Properties\analysis.ruleset</CodeAnalysisRuleSet>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
+ <ServerGarbageCollection>false</ServerGarbageCollection>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -23,14 +23,27 @@
</PropertyGroup>
<ItemGroup>
+ <AdditionalFiles Include="Properties\stylecop.json" />
<Content Include="slskd.yml">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+ <Content Update="wwwroot\**\*.*">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ </Content>
+ <None Include="..\..\LICENSE">
+ <Pack>True</Pack>
+ <PackagePath></PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.2" />
- <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="4.2.0" />
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.Versioning.ApiExplorer" Version="5.0.0" />
+ <PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="5.0.3">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ </PackageReference>
<PackageReference Include="Microsoft.Data.Sqlite" Version="5.0.2" />
<PackageReference Include="prometheus-net" Version="4.1.1" />
<PackageReference Include="prometheus-net.AspNetCore" Version="4.1.1" />
@@ -44,24 +57,17 @@
<PackageReference Include="Serilog.Sinks.File" Version="4.1.0" />
<PackageReference Include="Serilog.Sinks.Grafana.Loki" Version="5.0.0" />
<PackageReference Include="Serilog.Sinks.Http" Version="7.2.0" />
+ <PackageReference Include="SonarAnalyzer.CSharp" Version="8.18.0.27296">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ </PackageReference>
<PackageReference Include="Soulseek" Version="2.0.0" />
- <PackageReference Include="Swashbuckle.AspNetCore" Version="5.6.3" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
+ <PrivateAssets>all</PrivateAssets>
+ <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
+ </PackageReference>
+ <PackageReference Include="Swashbuckle.AspNetCore" Version="6.0.2" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.8.0" />
<PackageReference Include="YamlDotNet" Version="9.1.4" />
</ItemGroup>
-
- <ItemGroup>
- <Content Update="wwwroot\**\*.*">
- <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
- </Content>
- </ItemGroup>
-
- <ItemGroup>
- <None Include="..\..\LICENSE">
- <Pack>True</Pack>
- <PackagePath></PackagePath>
- <CopyToOutputDirectory>Always</CopyToOutputDirectory>
- </None>
- </ItemGroup>
-
</Project>