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

ActiveDirectoryDsc: Resolve style guideline violations for hashtables #516

Closed
johlju opened this issue Oct 6, 2019 · 0 comments · Fixed by #521 or #523
Closed

ActiveDirectoryDsc: Resolve style guideline violations for hashtables #516

johlju opened this issue Oct 6, 2019 · 0 comments · Fixed by #521 or #523
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

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\ActiveDirectoryDsc'...
remote: Enumerating objects: 4384, done.
                                                                                  s:  98% (4297/4384), 1.50 MiB | 1.46 MiB/s
Receiving objects: 100% (4384/4384), 1.71 MiB | 1.52 MiB/s, done.
Resolving deltas: 100% (2849/2849), done.
Cloning into 'C:\Users\Dan\AppData\Local\Temp\ActiveDirectoryDsc\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 | 678.00 KiB/s, done.
Resolving deltas: 100% (1263/1263), done.
    ____            __
   / __ \___  _____/ /____  _____
  / /_/ / _ \/ ___/ __/ _ \/ ___/
 / ____/  __(__  ) /_/  __/ /
/_/    \___/____/\__/\___/_/
Pester v4.9.0
Executing all tests in 'C:\Users\Dan\AppData\Local\Temp\ActiveDirectoryDsc\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_ADComputer.psm1 (Line 831): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_ADComputer.psm1 (Line 832): 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.5s
        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\ActiveDirectoryDsc\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_ADDomainTrust.psm1 (Line 495): 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.39s
        Expected $null, but got Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord.
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\ActiveDirectoryDsc\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_ADForestProperties.psm1 (Line 182): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_ADForestProperties.psm1 (Line 207): 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.36s
        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\ActiveDirectoryDsc\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_ADReplicationSiteLink.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: 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.66s
        Expected $null, but got Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord.
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\ActiveDirectoryDsc\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_ADServicePrincipalName.psm1 (Line 115): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_ADServicePrincipalName.psm1 (Line 142): 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.37s
        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\ActiveDirectoryDsc\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_ADUser.psm1 (Line 1653): 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.41s
        Expected $null, but got Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic.DiagnosticRecord.
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\ActiveDirectoryDsc\DSCResource.Tests\Meta.Tests.ps1: line 577
Tests completed in 46.12s
Tests Passed: 126, Failed: 6, 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 help wanted The issue is up for grabs for anyone in the community. labels Oct 6, 2019
SSvilen added a commit to SSvilen/ActiveDirectoryDsc that referenced this issue Oct 20, 2019
johlju added a commit to johlju/ActiveDirectoryDsc that referenced this issue Oct 29, 2019
- Fix hashtables according to style guideline (issue dsccommunity#516).
@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 29, 2019
johlju added a commit to johlju/ActiveDirectoryDsc that referenced this issue Oct 29, 2019
- Fix hashtables according to style guideline (issue dsccommunity#516).
johlju added a commit that referenced this issue Oct 29, 2019
…523)

- Changes to ActiveDirectoryDsc
  - Fix more hashtables according to style guidelines (issue #516).
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Jan 12, 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
Projects
None yet
1 participant