소스 검색

Merge pull request #686 from Bond-009/analyzers

Disable some StyleCop warnings
Joshua M. Boniface 6 년 전
부모
커밋
1d7d4c5738
2개의 변경된 파일18개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      Jellyfin.Server/Jellyfin.Server.csproj
  2. 13 0
      jellyfin.ruleset

+ 5 - 0
Jellyfin.Server/Jellyfin.Server.csproj

@@ -27,6 +27,11 @@
     <PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
   </ItemGroup>
 
+  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+    <RunCodeAnalysis>true</RunCodeAnalysis>
+    <CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
+  </PropertyGroup>
+
   <ItemGroup>
     <PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="2.2.0" />
     <PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.2.0" />

+ 13 - 0
jellyfin.ruleset

@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RuleSet Name="Rules for Jellyfin.Server" Description="Code analysis rules for Jellyfin.Server.csproj" ToolsVersion="14.0">
+  <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
+    <!-- disable warning SA1101: Prefix local calls with 'this.' -->
+    <Rule Id="SA1101" Action="None" />
+    <!-- disable warning SA1200: 'using' directive must appear within a namespace declaration -->
+    <Rule Id="SA1200" Action="None" />
+    <!-- disable warning SA1309: Fields must not begin with an underscore -->
+    <Rule Id="SA1309" Action="None" />
+    <!-- disable warning SA1633: The file header is missing or not located at the top of the file -->
+    <Rule Id="SA1633" Action="None" />
+  </Rules>
+</RuleSet>