Skip to content

Commit

Permalink
Merge branch 'release/1.1.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
abuzhynsky committed Mar 7, 2016
2 parents 931d4a4 + 111f3e8 commit 8f3818e
Show file tree
Hide file tree
Showing 23 changed files with 967 additions and 50 deletions.
25 changes: 23 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,12 +1,33 @@
root = true

[*]
end_of_line = CRLF

[*.{msbuild,xml}]
charset = utf-8
end_of_line = crlf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[*.md]
indent_size = 4
indent_size = 4

[*.{config,cs,json}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{proj,props,sln,targets}]
indent_style = tab
trim_trailing_whitespace = true

[*.{kproj,csproj,ps1,resx,rst}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true

[NuGet.Config]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -230,3 +230,7 @@ _Pvt_Extensions

# FAKE - F# Make
.fake/

.idea/
*.sln.iml
*.zip
99 changes: 57 additions & 42 deletions Plugin/agent/bin/PvsStudioIssueTypes.xml

Large diffs are not rendered by default.

41 changes: 37 additions & 4 deletions Plugin/agent/bin/ResharperReport.xslt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" encoding="UTF-8"/>
<xsl:param name="treatPriority1IssuesAsErrors" select="treatPriority1IssuesAsErrors"/>
<xsl:key name="project" match="PVS-Studio_Analysis_Log" use="Project" />
<xsl:key name="errorCode" match="PVS-Studio_Analysis_Log" use="ErrorCode" />
<xsl:variable name="issueTypes" select="document('PvsStudioIssueTypes.xml')" />
Expand All @@ -14,10 +15,10 @@
<Element>Solution</Element>
</InspectionScope>
</Information>
<xsl:apply-templates select="NewDataSet/PVS-Studio_Analysis_Log[generate-id(.)=generate-id(key('project',Project)[1])]" />
<IssueTypes>
<IssueTypes>
<xsl:apply-templates select="NewDataSet/PVS-Studio_Analysis_Log[generate-id(.)=generate-id(key('errorCode',ErrorCode)[1])]/ErrorCode" />
</IssueTypes>
<xsl:apply-templates select="NewDataSet/PVS-Studio_Analysis_Log[generate-id(.)=generate-id(key('project',Project)[1])]" />
</Report>

</xsl:template>
Expand Down Expand Up @@ -55,6 +56,38 @@

<xsl:template match="ErrorCode">
<xsl:variable name="error-code" select="text()"/>
<xsl:copy-of select="$issueTypes/IssueTypes/IssueType[@Id=$error-code]"/>
</xsl:template>
<xsl:variable name="issue-type" select="$issueTypes/IssueTypes/IssueType[@Id=$error-code]"/>
<xsl:variable name="issue-priority" select="current()/../Level/text()"/>
<xsl:choose>
<xsl:when test="$issue-type">
<xsl:element name="IssueType">
<xsl:attribute name="Id">
<xsl:value-of select="$issue-type/@Id" />
</xsl:attribute>
<xsl:attribute name="Category">
<xsl:value-of select="concat('PVS-Studio ', $issue-type/@Category, '. Priority: ', $issue-priority)" />
</xsl:attribute>
<xsl:attribute name="SubCategory">
<xsl:value-of select="concat($issue-type/@Id, '. ' $issue-type/@SubCategory)" />
</xsl:attribute>
<xsl:attribute name="Description">
<xsl:value-of select="$issue-type/@SubCategory" />
</xsl:attribute>
<xsl:choose>
<xsl:when test="$treatPriority1IssuesAsErrors = '1' and $issue-priority = '1'">
<xsl:attribute name="Severity">ERROR</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="Severity">
<xsl:value-of select="$issue-type/@Severity" />
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<IssueType Id="{$error-code}" Category="PVS-Studio Unknown Inspections. Priority: {$issue-priority}" SubCategory="{$error-code}. Unknown inspection. Please update plugin." Description="Unknown inspection. Please update plugin." Severity="WARNING" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,14 @@
<!-- Mandatory Fields -->
<param name="teamcity.tool.pvs-studio.runner.pvs-studio-path" value="" spec="text description='PVS Studio installation folder' display='normal' label='PVS Studio installation folder' validationMode='not_empty'" />
<param name="teamcity.tool.pvs-studio.runner.solution-path" value="" spec="text description='Solution to analyze' display='normal' label='Solution to analyze' validationMode='not_empty'" />
<param name="teamcity.tool.pvs-studio.runner.solution-path" value="" spec="text description='Solution to analyze' display='normal' label='Solution to analyze' validationMode='not_empty'" />
<param name="teamcity.tool.pvs-studio.runner.treatPriority1IssuesAsErrors" value="" spec="checkbox description='Treat priority 1 issues as errors' label='Treat priority 1 issues as errors' uncheckedValue='0' display='normal' checkedValue='1'" />
</parameters>
<build-runners>
<runner name="" type="simpleRunner">
<parameters>
<param name="script.content"><![CDATA["%teamcity.tool.pvs-studio.runner.pvs-studio-path%\PVS-Studio_Cs.exe" -r -o "%env.TEMP%\PvsStudioResults_%build.number%.xml" -t %teamcity.build.checkoutDir%/%teamcity.tool.pvs-studio.runner.solution-path%
%teamcity.agent.tools.dir%\pvs-studio-build-runner\bin\msxsl.exe "%env.TEMP%\PvsStudioResults_%build.number%.xml" %teamcity.agent.tools.dir%\pvs-studio-build-runner\bin\ResharperReport.xslt -o "%env.TEMP%\PvsStudioInspectCode_%build.number%.xml"
%teamcity.agent.tools.dir%\pvs-studio-build-runner\bin\msxsl.exe "%env.TEMP%\PvsStudioResults_%build.number%.xml" %teamcity.agent.tools.dir%\pvs-studio-build-runner\bin\ResharperReport.xslt -o "%env.TEMP%\PvsStudioInspectCode_%build.number%.xml" treatPriority1IssuesAsErrors="%teamcity.tool.pvs-studio.runner.treatPriority1IssuesAsErrors%"
echo ##teamcity[importData type='ReSharperInspectCode' path='%env.TEMP%\PvsStudioInspectCode_%build.number%.xml']]]></param>
<param name="teamcity.step.mode" value="default" />
<param name="use.custom.script" value="true" />
Expand Down
2 changes: 1 addition & 1 deletion Plugin/teamcity-plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<info>
<name>PvsStudioBuildRunnerPlugin</name>
<display-name>PVS Studio Build Runner</display-name>
<version>snapshot</version>
<version>1.1.0.0</version>
<description>Adds a PVS Studio Build Step option to TeamCity</description>
<vendor>
<name>Ales Buzhynsky</name>
Expand Down
18 changes: 18 additions & 0 deletions documents/releaseNotes/1.1.0.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#TeamCity PVS Studio Meta-Runner v1.1.0.0

##Changes:

###Added grouping by category name and priority (e.g. PVS-Studio General Analysis Priority: 1)

###Added possibility to treat priority 1 issues as errors
Now there is a checkbox in build step to toggle this behaviour.

###Added PVS-Studio 6.01 inspections support

###Added support of PVS-Studio next releases inspections
They will be displayed without category name in build results but with inspection Id and inspection message.

##Update instructions:
1. Download 'pvs-studio-build-runner.zip' from the [latest release](https://github.com/abuzhynsky/teamcity-pvs-studio-meta-runner/releases/latest)
2. Copy this file into the _[Team City Data Directory]\plugins_ directory on the TeamCity Server, by default this is _C:\ProgramData\JetBrains\TeamCity\plugins_ or upload it using TeamCity 'Plugins List' tab (_Administration-Plugins List_)
3. Restart the Team City server
28 changes: 28 additions & 0 deletions tests/TeamCity.PvsStudio.MetaRunner.Tests.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.24720.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCity.PvsStudio.MetaRunner.TestProject", "app\TeamCity.PvsStudio.MetaRunner.TestProject\TeamCity.PvsStudio.MetaRunner.TestProject.csproj", "{0C821208-FBE5-4421-826C-E9E22ADF7303}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamCity.PvsStudio.MetaRunner.Tests", "tests\TeamCity.PvsStudio.MetaRunner.Tests\TeamCity.PvsStudio.MetaRunner.Tests.csproj", "{282843E9-1846-4874-805A-5CCB59B3E633}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{0C821208-FBE5-4421-826C-E9E22ADF7303}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C821208-FBE5-4421-826C-E9E22ADF7303}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C821208-FBE5-4421-826C-E9E22ADF7303}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C821208-FBE5-4421-826C-E9E22ADF7303}.Release|Any CPU.Build.0 = Release|Any CPU
{282843E9-1846-4874-805A-5CCB59B3E633}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{282843E9-1846-4874-805A-5CCB59B3E633}.Debug|Any CPU.Build.0 = Debug|Any CPU
{282843E9-1846-4874-805A-5CCB59B3E633}.Release|Any CPU.ActiveCfg = Release|Any CPU
{282843E9-1846-4874-805A-5CCB59B3E633}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions tests/TeamCity.PvsStudio.MetaRunner.Tests.sln.DotSettings
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/ExcludedFiles/FilesAndFoldersToSkip2/=0C821208_002DFBE5_002D4421_002D826C_002DE9E22ADF7303_002Ff_003AClass1_002Ecs/@EntryIndexedValue">ExplicitlyExcluded</s:String></wpf:ResourceDictionary>
22 changes: 22 additions & 0 deletions tests/app/TeamCity.PvsStudio.MetaRunner.TestProject/Class1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace TeamCity.PvsStudio.MetaRunner.TestProject
{
public class Class1
{
public void Method()
{
//intentionally made mistakes for PVS-Studio testing
var s = "qwerty";

string f = null;

var a = 0;

if (f == string.Empty || f == string.Empty)
{
a = 5;
}

s.Replace("s", a.ToString());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("TeamCity.PvsStudio.MetaRunner.TestProject")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TeamCity.PvsStudio.MetaRunner.TestProject")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("0c821208-fbe5-4421-826c-e9e22adf7303")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0C821208-FBE5-4421-826C-E9E22ADF7303}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TeamCity.PvsStudio.MetaRunner.TestProject</RootNamespace>
<AssemblyName>TeamCity.PvsStudio.MetaRunner.TestProject</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AssemblyVersion>1.0.0.0</AssemblyVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
Loading

0 comments on commit 8f3818e

Please sign in to comment.