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

SqlServerDsc: Resolve style guideline violations for hashtables #1437

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

SqlServerDsc: Resolve style guideline violations for hashtables #1437

johlju opened this issue Oct 6, 2019 · 0 comments · Fixed by #1447 or #1494
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\SqlServerDsc\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 | 983.00 KiB/s, done.
Resolving deltas: 100% (1263/1263), done.
    ____            __
   / __ \___  _____/ /____  _____
  / /_/ / _ \/ ___/ __/ _ \/ ___/
 / ____/  __(__  ) /_/  __/ /
/_/    \___/____/\__/\___/_/
Pester v4.9.0
Executing all tests in 'C:\Users\Dan\AppData\Local\Temp\SqlServerDsc\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_SqlDatabaseUser.psm1 (Line 520): 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.
        577:                         $customPssaRulesOutput | Should -Be $null
        at <ScriptBlock>, C:\Users\Dan\AppData\Local\Temp\SqlServerDsc\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_SqlSetup.psm1 (Line 1278): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1323): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1372): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1385): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1408): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1414): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1420): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1426): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1432): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1443): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1448): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1469): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1473): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1508): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1519): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1532): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1541): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1548): Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects
WARNING: MSFT_SqlSetup.psm1 (Line 1567): 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\SqlServerDsc\DSCResource.Tests\Meta.Tests.ps1: line 577
Tests completed in 69.88s
Tests Passed: 220, Failed: 2, 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
@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/SqlServerDsc that referenced this issue Oct 29, 2019
  - Fix hashtables to align with style guideline (issue dsccommunity#1437).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 3, 2019
  - Fix hashtables to align with style guideline (issue dsccommunity#1437).
johlju added a commit to johlju/SqlServerDsc that referenced this issue Nov 26, 2019
  - Fix hashtables to align with style guideline (issue dsccommunity#1437).
johlju added a commit that referenced this issue Nov 27, 2019
…nd fix hashtables (#1447)

- Changes to SqlServerDsc
  - Add .gitattributes file to checkout file correctly with CRLF.
  - Updated .vscode/analyzersettings.psd1 file to correct use PSSA rules
    and custom rules in VS Code.
  - Fix hashtables to align with style guideline (issue #1437).
- Changes to SqlServerMaxDop
  - Fix line endings in code which did not use the correct format.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Nov 27, 2019
johlju added a commit that referenced this issue Jan 1, 2020
…nd fix hashtables (#1447)

- Changes to SqlServerDsc
  - Add .gitattributes file to checkout file correctly with CRLF.
  - Updated .vscode/analyzersettings.psd1 file to correct use PSSA rules
    and custom rules in VS Code.
  - Fix hashtables to align with style guideline (issue #1437).
- Changes to SqlServerMaxDop
  - Fix line endings in code which did not use the correct format.
johlju added a commit to johlju/SqlServerDsc that referenced this issue Apr 10, 2020
  - Fix hashtables to align with style guideline (issue dsccommunity#1437).
johlju added a commit that referenced this issue Apr 11, 2020
- SqlAG
  - Fix hashtables to align with style guideline (issue #1437).
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