mirror of
https://github.com/ppy/osu.git
synced 2025-02-11 06:32:54 +08:00
Also analyze the code for spaces and warnings.
This commit is contained in:
parent
6a661d1766
commit
aef824b13d
1
.gitignore
vendored
1
.gitignore
vendored
@ -102,6 +102,7 @@ $tf/
|
|||||||
_ReSharper*/
|
_ReSharper*/
|
||||||
*.[Rr]e[Ss]harper
|
*.[Rr]e[Ss]harper
|
||||||
*.DotSettings.user
|
*.DotSettings.user
|
||||||
|
inspectcode
|
||||||
|
|
||||||
# JustCode is a .NET coding add-in
|
# JustCode is a .NET coding add-in
|
||||||
.JustCode
|
.JustCode
|
||||||
|
22
appveyor.yml
22
appveyor.yml
@ -1,24 +1,8 @@
|
|||||||
clone_depth: 1
|
clone_depth: 1
|
||||||
version: '{branch}-{build}'
|
version: '{branch}-{build}'
|
||||||
image: Visual Studio 2017
|
image: Visual Studio 2017
|
||||||
configuration: Debug
|
test: off
|
||||||
cache:
|
|
||||||
- C:\ProgramData\chocolatey\bin -> appveyor.yml
|
|
||||||
- C:\ProgramData\chocolatey\lib -> appveyor.yml
|
|
||||||
install:
|
install:
|
||||||
- cmd: git submodule update --init --recursive --depth=5
|
- cmd: git submodule update --init --recursive --depth=5
|
||||||
- cmd: choco install resharper-clt -y
|
build_script:
|
||||||
- cmd: choco install nvika -y
|
- cmd: PowerShell -Version 2.0 .\build.ps1
|
||||||
- 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
|
|
||||||
|
22
build.cake
22
build.cake
@ -1,4 +1,7 @@
|
|||||||
#tool "nuget:?package=JetBrains.ReSharper.CommandLineTools"
|
#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
|
// ARGUMENTS
|
||||||
@ -9,7 +12,7 @@ var framework = Argument("framework", "net471");
|
|||||||
var configuration = Argument("configuration", "Release");
|
var configuration = Argument("configuration", "Release");
|
||||||
|
|
||||||
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
|
var osuDesktop = new FilePath("./osu.Desktop/osu.Desktop.csproj");
|
||||||
|
var osuSolution = new FilePath("./osu.sln");
|
||||||
var testProjects = GetFiles("**/*.Tests.csproj");
|
var testProjects = GetFiles("**/*.Tests.csproj");
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -37,11 +40,26 @@ Task("Test")
|
|||||||
|
|
||||||
Task("InspectCode")
|
Task("InspectCode")
|
||||||
.Does(() => {
|
.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")
|
Task("Build")
|
||||||
|
.IsDependentOn("CodeFileSanity")
|
||||||
.IsDependentOn("Compile")
|
.IsDependentOn("Compile")
|
||||||
|
.IsDependentOn("InspectCode")
|
||||||
.IsDependentOn("Test");
|
.IsDependentOn("Test");
|
||||||
|
|
||||||
RunTarget(target);
|
RunTarget(target);
|
@ -1,2 +0,0 @@
|
|||||||
[Nuget]
|
|
||||||
UseInProcessClient=false
|
|
18
inspectcodereport.xml
Normal file
18
inspectcodereport.xml
Normal 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>
|
Loading…
Reference in New Issue
Block a user