Also analyze the code for spaces and warnings.

This commit is contained in:
miterosan 2018-07-30 02:12:39 +02:00
parent 6a661d1766
commit aef824b13d
5 changed files with 42 additions and 23 deletions

1
.gitignore vendored
View File

@ -102,6 +102,7 @@ $tf/
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
inspectcode
# JustCode is a .NET coding add-in
.JustCode

View File

@ -1,24 +1,8 @@
clone_depth: 1
version: '{branch}-{build}'
image: Visual Studio 2017
configuration: Debug
cache:
- C:\ProgramData\chocolatey\bin -> appveyor.yml
- C:\ProgramData\chocolatey\lib -> appveyor.yml
test: off
install:
- cmd: git submodule update --init --recursive --depth=5
- cmd: choco install resharper-clt -y
- cmd: choco install nvika -y
- cmd: appveyor DownloadFile https://github.com/peppy/CodeFileSanity/releases/download/v0.2.5/CodeFileSanity.exe
before_build:
- cmd: CodeFileSanity.exe
- cmd: nuget restore -verbosity quiet
environment:
TargetFramework: net471
build:
project: osu.sln
parallel: true
verbosity: minimal
after_build:
- cmd: inspectcode --o="inspectcodereport.xml" --projects:osu.Game* --caches-home="inspectcode" osu.sln > NUL
- cmd: NVika parsereport "inspectcodereport.xml" --treatwarningsaserrors
build_script:
- cmd: PowerShell -Version 2.0 .\build.ps1

View File

@ -1,4 +1,7 @@
#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools"
#tool "nuget:?package=NVika.MSBuild"
var NVikaToolPath = GetFiles("./tools/NVika.MSBuild.*/tools/NVika.exe").First();
var CodeFileSanityToolPath = DownloadFile("https://github.com/peppy/CodeFileSanity/releases/download/v0.2.5/CodeFileSanity.exe");
///////////////////////////////////////////////////////////////////////////////
// ARGUMENTS
@ -9,7 +12,7 @@ var framework = Argument("framework", "net471");
var configuration = Argument("configuration", "Release");
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
var osuSolution = new FilePath("./osu.sln");
var testProjects = GetFiles("**/*.Tests.csproj");
///////////////////////////////////////////////////////////////////////////////
@ -37,11 +40,26 @@ Task("Test")
Task("InspectCode")
.Does(() => {
InspectCode(osuSolution, new InspectCodeSettings {
CachesHome = "inspectcode",
OutputFile = "inspectcodereport.xml",
});
StartProcess(NVikaToolPath, @"parsereport ""inspectcodereport.xml"" --treatwarningsaserrors");
});
Task("CodeFileSanity")
.Does(() => {
var result = StartProcess(CodeFileSanityToolPath);
if (result != 0)
throw new Exception("Code sanity failed.");
});
Task("Build")
.IsDependentOn("CodeFileSanity")
.IsDependentOn("Compile")
.IsDependentOn("InspectCode")
.IsDependentOn("Test");
RunTarget(target);

View File

@ -1,2 +0,0 @@
[Nuget]
UseInProcessClient=false

18
inspectcodereport.xml Normal file
View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generated by JetBrains Inspect Code 2018.1.3 -->
<Report ToolsVersion="112.0.20180626.161933">
<Information>
<Solution>osu.sln</Solution>
<InspectionScope>
<Element>Solution</Element>
</InspectionScope>
</Information>
<IssueTypes>
<IssueType Id="UnusedField.Compiler" Category="Compiler Warnings" CategoryId="CompilerWarnings" Description="Field is never used" Severity="WARNING" />
</IssueTypes>
<Issues>
<Project Name="osu.Game.Tests">
<Issue TypeId="UnusedField.Compiler" File="osu.Game.Tests\WaveformTestBeatmap.cs" Offset="593-595" Line="22" Message="Field 'OK' is never used" />
</Project>
</Issues>
</Report>