From affa6b1297a8afbe6baec6dcd54fdd97cf66138b Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Thu, 30 Jul 2020 17:25:02 +0300 Subject: [PATCH] [Windows] Add yamllint support for the default Python version only (#1320) * Add yamllint support * fix yamllint verion output * move yamllint to the Tools section --- images/win/Windows2016-Azure.json | 3 ++- images/win/Windows2019-Azure.json | 3 ++- images/win/scripts/Installers/Install-YAMLLint.ps1 | 3 +++ .../win/scripts/SoftwareReport/SoftwareReport.Common.psm1 | 4 ++++ .../win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 | 3 ++- images/win/scripts/Tests/Tools.Tests.ps1 | 6 ++++++ 6 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 images/win/scripts/Installers/Install-YAMLLint.ps1 diff --git a/images/win/Windows2016-Azure.json b/images/win/Windows2016-Azure.json index 08429f3c8..0e1fabbf3 100644 --- a/images/win/Windows2016-Azure.json +++ b/images/win/Windows2016-Azure.json @@ -339,7 +339,8 @@ "scripts":[ "{{ template_dir }}/scripts/Installers/Install-PyPy.ps1", "{{ template_dir }}/scripts/Installers/Install-Toolset.ps1", - "{{ template_dir }}/scripts/Installers/Configure-Toolset.ps1" + "{{ template_dir }}/scripts/Installers/Configure-Toolset.ps1", + "{{ template_dir }}/scripts/Installers/Install-YAMLLint.ps1" ] }, { diff --git a/images/win/Windows2019-Azure.json b/images/win/Windows2019-Azure.json index fd25e63a7..137b52562 100644 --- a/images/win/Windows2019-Azure.json +++ b/images/win/Windows2019-Azure.json @@ -314,7 +314,8 @@ "scripts":[ "{{ template_dir }}/scripts/Installers/Install-PyPy.ps1", "{{ template_dir }}/scripts/Installers/Install-Toolset.ps1", - "{{ template_dir }}/scripts/Installers/Configure-Toolset.ps1" + "{{ template_dir }}/scripts/Installers/Configure-Toolset.ps1", + "{{ template_dir }}/scripts/Installers/Install-YAMLLint.ps1" ] }, { diff --git a/images/win/scripts/Installers/Install-YAMLLint.ps1 b/images/win/scripts/Installers/Install-YAMLLint.ps1 new file mode 100644 index 000000000..1ebc09a33 --- /dev/null +++ b/images/win/scripts/Installers/Install-YAMLLint.ps1 @@ -0,0 +1,3 @@ +pip install yamllint + +Invoke-PesterTests -TestFile "Tools" -TestName "yamllint" \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 index 965b5fb93..05b101aac 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Common.psm1 @@ -270,3 +270,7 @@ function Get-PacmanVersion { $pacmanVersion = $matches[0] return "- Pacman $pacmanVersion" } + +function Get-YAMLLintVersion { + yamllint --version +} \ No newline at end of file diff --git a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 index 49f15be6f..a9968f8c0 100644 --- a/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 +++ b/images/win/scripts/SoftwareReport/SoftwareReport.Generator.ps1 @@ -98,7 +98,8 @@ $markdown += New-MDList -Style Unordered -Lines @( (Get-WinAppDriver), (Get-ZstdVersion), (Get-VSWhereVersion), - (Get-7zipVersion) + (Get-7zipVersion), + (Get-YAMLLintVersion) ) $markdown += New-MDHeader "CLI Tools" -Level 3 diff --git a/images/win/scripts/Tests/Tools.Tests.ps1 b/images/win/scripts/Tests/Tools.Tests.ps1 index 12278e43b..fe3343cf7 100644 --- a/images/win/scripts/Tests/Tools.Tests.ps1 +++ b/images/win/scripts/Tests/Tools.Tests.ps1 @@ -247,6 +247,12 @@ Describe "ServiceFabricSDK" { } } +Describe "yamllint" { + It "yamllint" { + "yamllint --version" | Should -ReturnZeroExitCode + } +} + Describe "Svn" { It "svn" { "svn --version --quiet" | Should -ReturnZeroExitCode