Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xWebAdministration: Resolve style guideline violations for hashtables #524

Closed
johlju opened this issue Oct 6, 2019 · 12 comments · Fixed by #530
Closed

xWebAdministration: Resolve style guideline violations for hashtables #524

johlju opened this issue Oct 6, 2019 · 12 comments · Fixed by #530
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub hacktoberfest See https://hacktoberfest.digitalocean.com/

Comments

@johlju
Copy link
Member

johlju commented Oct 6, 2019

We are adding a PSSA rule that validates hashtables to be correct according to the style guideline (PR PowerShell/DscResource.Tests#348).

Since we have opt-in to the common test that validates these rules we need to make sure to update all the hashtables that still does not comply to the style guideline. After that we will merge the rule into the test framework.

Below are all the style guideline violations that need to be resolved for this repo.

Cloning into 'C:\Users\Dan\AppData\Local\Temp\xWebAdministration'...
remote: Enumerating objects: 5604, done.

Receiving objects: 100% (5604/5604), 1.72 MiB | 1.54 MiB/s, done.
Resolving deltas: 100% (3590/3590), done.
Cloning into 'C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 2071 (delta 1), reused 3 (delta 1), pack-reused 2057
Receiving objects: 100% (2071/2071), 920.01 KiB | 979.00 KiB/s, done.
Resolving deltas: 100% (1263/1263), done.
    ____            __
   / __ \___  _____/ /____  _____
  / /_/ / _ \/ ___/ __/ _ \/ ___/
 / ____/  __(__  ) /_/  __/ /
/_/    \___/____/\__/\___/_/
Pester v4.9.0
Executing all tests in 'C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1' matching test name Common Tests - PS Script Analyzer on Resource Files
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xIisHandler.psm1 (Line 25): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 33): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 43): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 53): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 61): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 69): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 79): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 89): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 99): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 109): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 119): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 128): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 136): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 146): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 156): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 164): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 174): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 184): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 193): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 203): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 213): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 221): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 229): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 239): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 249): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 259): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 269): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 277): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 285): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 295): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 305): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 315): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 325): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 335): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 343): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 351): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 359): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 369): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 379): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 389): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 399): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 407): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 417): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 427): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 435): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 443): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 452): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 460): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 468): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 478): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 488): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 498): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 508): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 516): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 524): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 532): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 541): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 549): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 559): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 569): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 577): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 585): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 593): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 601): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 611): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 621): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 629): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 639): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 649): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 657): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 665): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 674): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 682): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 690): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 700): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 710): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 720): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 730): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 738): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 748): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 758): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 766): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 776): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisHandler.psm1 (Line 874): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 2.08s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAn
alyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAna
lyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnal
yzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xIisMimeTypeMapping.psm1 (Line 151): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisMimeTypeMapping.psm1 (Line 160): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 1.38s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xIisModule.psm1 (Line 410): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xIisModule.psm1 (Line 418): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 1.44s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xWebApplication.psm1 (Line 259): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebApplication.psm1 (Line 546): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebApplication.psm1 (Line 620): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 1.49s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAn
alyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xWebAppPool.psm1 (Line 39): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 40): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 41): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 42): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 43): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 44): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 45): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 46): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 47): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 48): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 49): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 52): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 53): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 54): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 55): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 56): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 57): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 60): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 61): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 62): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 63): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 64): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 65): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 66): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 67): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 68): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 69): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 70): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 71): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 72): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 73): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 76): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 77): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 78): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 81): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 82): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 83): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 84): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 85): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 86): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 89): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 90): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 91): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 92): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 93): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 94): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 95): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebAppPool.psm1 (Line 96): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 1.65s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAn
alyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAna
lyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnal
yzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xWebConfigPropertyCollection.psm1 (Line 260): Hashtable is not correctly formatted. See
https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebConfigPropertyCollection.psm1 (Line 288): Hashtable is not correctly formatted. See
https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 1.46s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
WARNING: Custom DSC Resource Kit PSSA rule(s) did not pass.
WARNING: The following PSScriptAnalyzer rule 'DscResource.AnalyzerRules\Measure-Hashtable' errors need to be fixed:
WARNING: MSFT_xWebsite.psm1 (Line 623): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebsite.psm1 (Line 1299): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebsite.psm1 (Line 1775): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_xWebsite.psm1 (Line 2224): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: For instructions on how to run PSScriptAnalyzer on your own machine, please go to https://github.com/powershell/PSScriptAnalyzer
      [-] Should pass all custom DSC Resource Kit PSSA rules 1.97s
        Expected $null, but got @(Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAn
alyzer.Generic.DiagnosticRecord, Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord).
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\xWebAdministration\DSCResource.Tests\Meta.Tests.ps1: line 577
Tests completed in 30.39s
Tests Passed: 89, Failed: 7, Skipped: 0, Pending: 0, Inconclusive: 0
@johlju johlju added enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub hacktoberfest See https://hacktoberfest.digitalocean.com/ help wanted The issue is up for grabs for anyone in the community. labels Oct 6, 2019
@tomlarse
Copy link
Contributor

tomlarse commented Oct 6, 2019

Thought I would take a crack at this, but the first one it has problems with is line 2 here:

$script:handlers = @{
    'aspq-Integrated-4.0' = (New-Object PSObject -Property @{
            Name = 'aspq-Integrated-4.0';
            Path = '*.aspq';
            Verb = 'GET,HEAD,POST,DEBUG';
            Type = 'System.Web.HttpForbiddenHandler';
            PreCondition = 'integratedMode,runtimeVersionv4.0'
    });
### A lot more similar keys
}

How is that supposed to be formatted to comply with the rule? Seems silly to have to load it into a variable first?

@johlju
Copy link
Member Author

johlju commented Oct 7, 2019

Let me check on that tonight. It looks like it formatted correctly except the semi-colon that shouldn’t be necessary. This is a new rule so it could be edge cases that we haven’t thought of. It is possible it is a false negative.

In regards to adding it to a script scope variable, not sure why it is done this way. It might be able to be improved as well but could be another issue/PR. Let me check on that as well.

@tomlarse
Copy link
Contributor

tomlarse commented Oct 7, 2019

Sounds good!

I wasn't really referring to the script scope variable, but the only solution I found that was accepted by Measure-Hashtable was doing something like

$property = @{
        Name = 'aspq-Integrated-4.0';
        Path = '*.aspq';
        Verb = 'GET,HEAD,POST,DEBUG';
        Type = 'System.Web.HttpForbiddenHandler';
        PreCondition = 'integratedMode,runtimeVersionv4.0'
}
$script:handlers = @{
    'aspq-Integrated-4.0' = (New-Object PSObject -Property $property);
### A lot more similar keys
}

I apparently felt that was obvious to everyone when I wrote the comment late last night 😂

@johlju
Copy link
Member Author

johlju commented Oct 7, 2019

Ah, then I follow you :) Didn’t realize that you tested different ways of solving it :) I don’t think we should need to do such workaround.

@SSvilen do you have a thought on this? Is this and edge case we need to handle in then rule? Is it hashtable inside an another hashtable that is the problem here? 🤔

@johlju
Copy link
Member Author

johlju commented Oct 7, 2019

@tomlarse Thank you for finding this and actually manually test against the new rule! 😃

@SSvilen
Copy link

SSvilen commented Oct 7, 2019

In the rule I've assumed that the hashtable ends with \s*} (as regex).
In other words - the line contains only closing parenthesis leaded only by whitespace charachters.
So

 '});' 

would violate it,
but

  } 

won't

@tomlarse
Copy link
Contributor

tomlarse commented Oct 7, 2019

It still fails it if I do that though:

image

@tomlarse
Copy link
Contributor

tomlarse commented Oct 7, 2019

Seems like it was the indentation it didn't like.
image

I'll remove the semicolons and put the paranthesis on it's own line then? @johlju?

@tomlarse
Copy link
Contributor

tomlarse commented Oct 7, 2019

I'm not sure what the parenthesis contribute with? It looks much nicer without them :)

$script:handlers = @{
    'aspq-Integrated-4.0' = New-Object PSObject -Property @{
        Name         = 'aspq-Integrated-4.0';
        Path         = '*.aspq';
        Verb         = 'GET,HEAD,POST,DEBUG';
        Type         = 'System.Web.HttpForbiddenHandler';
        PreCondition = 'integratedMode,runtimeVersionv4.0'
    }
### more similar keys
}
$script:handlers = @{
    'aspq-Integrated-4.0' = (New-Object PSObject -Property @{
        Name         = 'aspq-Integrated-4.0';
        Path         = '*.aspq';
        Verb         = 'GET,HEAD,POST,DEBUG';
        Type         = 'System.Web.HttpForbiddenHandler';
        PreCondition = 'integratedMode,runtimeVersionv4.0'
    }
    )
### more similar keys
}

@johlju
Copy link
Member Author

johlju commented Oct 7, 2019

@tomlarse Yes we should not need the parenthesis in that call. Also remove the semi-colon. Thanks! 😃

@SSvilen
Copy link

SSvilen commented Oct 7, 2019

@tomlarse @johlju The correct indentation is also being proofed ;)

Hashtables and Objects should be written in the following format. Each property should be on its own line indented once.

@johlju
Copy link
Member Author

johlju commented Oct 7, 2019

@SSvilen Thank you! 🙂 I missed the indentation when I looked at the code snippet, I wrongly assumed it was indented correctly 😄

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Oct 7, 2019
johlju pushed a commit that referenced this issue Oct 8, 2019
- Changes to xWebAdministration
  - Updated hashtables in the repo to adhere to the style guidelines described at https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects (issue #524).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Oct 8, 2019
gstorme pushed a commit to gstorme/xWebAdministration that referenced this issue Feb 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request. good first issue The issue should be easier to fix and can be taken up by a beginner to learn to contribute on GitHub hacktoberfest See https://hacktoberfest.digitalocean.com/
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants