From a20cf1ad837276d3d30dae1e7bb85833a9d1862a Mon Sep 17 00:00:00 2001 From: Michael Ganss Date: Wed, 15 May 2019 14:13:57 +0200 Subject: [PATCH] Update appveyor.yml --- appveyor.yml | 6 ++---- src/HtmlSanitizer/HtmlSanitizer.csproj | 13 +++++++++---- src/HtmlSanitizer/Properties/AssemblyInfo.cs | 2 -- test/HtmlSanitizer.Tests/Tests.cs | 6 ++++-- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 7a7eccc..c97edb0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,4 +1,4 @@ -version: 4.0.{build} +version: 5.0.{build} skip_tags: true image: Visual Studio 2017 environment: @@ -9,14 +9,13 @@ environment: nuget: disable_publish_on_pr: true build_script: - - ps: (Get-Content src\HtmlSanitizer\HtmlSanitizer.csproj).Replace("1.0.0-VERSION", $env:APPVEYOR_BUILD_VERSION) | Set-Content src\HtmlSanitizer\HtmlSanitizer.csproj - dotnet restore - dotnet pack --include-symbols --include-source -c Release src\HtmlSanitizer test_script: - ps: | if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) { dotnet tool install --global dotnet-sonarscanner - dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /d:sonar.organization="mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs" + dotnet sonarscanner begin /k:"mganss_HtmlSanitizer" /v:$env:APPVEYOR_BUILD_VERSION /o:"mganss-github" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.login="$env:sonar_token" /d:sonar.cs.opencover.reportsPaths="$($env:APPVEYOR_BUILD_FOLDER)\coverage.xml" /d:sonar.coverage.exclusions="**/Program.cs" dotnet build } - dotnet test /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:CoverletOutput="..\..\coverage.xml" test\HtmlSanitizer.Tests\HtmlSanitizer.Tests.csproj -f netcoreapp2.0 @@ -24,7 +23,6 @@ test_script: if (-not $env:APPVEYOR_PULL_REQUEST_NUMBER) { dotnet sonarscanner end /d:sonar.login="$env:sonar_token" } - - "SET PATH=C:\\Python34;C:\\Python34\\Scripts;%PATH%" - pip install codecov - codecov -f "coverage.xml" artifacts: diff --git a/src/HtmlSanitizer/HtmlSanitizer.csproj b/src/HtmlSanitizer/HtmlSanitizer.csproj index 6aa8b06..8913b8e 100644 --- a/src/HtmlSanitizer/HtmlSanitizer.csproj +++ b/src/HtmlSanitizer/HtmlSanitizer.csproj @@ -2,9 +2,12 @@ Cleans HTML from constructs that can be used for cross site scripting (XSS) - Copyright 2013-2018 Michael Ganss + Copyright 2013-$([System.DateTime]::Now.Year) Michael Ganss HtmlSanitizer - 1.0.0-VERSION + 1.0.0 + 5.0.0.0 + $(AppVeyor_Build_Version).0 + $(AppVeyor_Build_Version)-beta Michael Ganss net46;netstandard2.0 HtmlSanitizer @@ -14,13 +17,15 @@ HtmlSanitizer xss;anti;antixss;html;security https://github.com/mganss/HtmlSanitizer - https://raw.github.com/mganss/HtmlSanitizer/master/LICENSE.md + MIT git git://github.com/mganss/HtmlSanitizer - false Ganss.XSS true bin\$(Configuration)\$(TargetFramework)\HtmlSanitizer.xml + true + true + true diff --git a/src/HtmlSanitizer/Properties/AssemblyInfo.cs b/src/HtmlSanitizer/Properties/AssemblyInfo.cs index 28af30f..7df8d9c 100644 --- a/src/HtmlSanitizer/Properties/AssemblyInfo.cs +++ b/src/HtmlSanitizer/Properties/AssemblyInfo.cs @@ -12,5 +12,3 @@ using System.Runtime.InteropServices; [assembly: Guid("16af04e9-e712-417e-b749-c8d10148dda9")] #endif - -[assembly: AssemblyVersion("3.0.0.0")] diff --git a/test/HtmlSanitizer.Tests/Tests.cs b/test/HtmlSanitizer.Tests/Tests.cs index 248277f..993fe68 100644 --- a/test/HtmlSanitizer.Tests/Tests.cs +++ b/test/HtmlSanitizer.Tests/Tests.cs @@ -2430,8 +2430,10 @@ rl(javascript:alert(""foo""))'>"; var allowedStyles = new[] { "margin-top" }; RemoveReason? actual = null; - var s = new HtmlSanitizer(allowedTags: allowedTags, allowedAttributes: allowedAttributes, allowedCssProperties: allowedStyles); - s.DisallowCssPropertyValue = new Regex(@"\d+.*"); + var s = new HtmlSanitizer(allowedTags: allowedTags, allowedAttributes: allowedAttributes, allowedCssProperties: allowedStyles) + { + DisallowCssPropertyValue = new Regex(@"\d+.*") + }; s.RemovingStyle += (sender, args) => { actual = args.Reason;