diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb17e6..f02f60b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Update build files to allow everything to work - Update build files to include tasks for deploy - Update pipeline to use the correct default branch +- Update references to dsccommunity fixes [#12](https://github.com/dsccommunity/DscResource.AnalyzerRules/issues/12) +and [#9](https://github.com/dsccommunity/DscResource.AnalyzerRules/issues/9). + - `DscResource.AnalyzerRules.psd1` + - `CONTRIBUTING.md` + - `Get-LocalizedData.Tests.ps1` ## [0.2.0] - 2019-11-21 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 767e34f..e7be23a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -6,7 +6,7 @@ change helps make the DSC resources even better for everyone to use. ## Common contribution guidelines This resource module follow all of the common contribution guidelines for -DSC resource modules [outlined in DscResources repository](https://github.com/PowerShell/DscResources/blob/master/CONTRIBUTING.md), +DSC resource modules [outlined in DscResources repository](https://dsccommunity.org/guidelines/contributing/), so please review these as a baseline for contributing. ## Specific guidelines for this resource module @@ -74,7 +74,7 @@ be placed in the resource module file [DscResource.Common](/Modules/DscResource. ### Localization -Please see the localization section in the [style guideline](https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#localization). +Please see the localization section in the [style guideline](https://dsccommunity.org/styleguidelines/localization/). The helper functions is found in the module [DscResource.LocalizationHelper](/Modules/DscResource.LocalizationHelper/DscResource.LocalizationHelper.psm1). ### Unit tests @@ -134,7 +134,7 @@ Invoke-Pester .\DSCResource.Tests\Meta.Tests.ps1 Integration tests should be written for resources so they can be validated by the automated test framework which is run in AppVeyor when commits are pushed to a Pull Request (PR). -Please see the [Testing Guidelines](https://github.com/PowerShell/DscResources/blob/master/TestsGuidelines.md) +Please see the [Testing Guidelines](https://dsccommunity.org/guidelines/testing-guidelines/) for common DSC Resource Kit testing guidelines. There are also configurations made by existing integration tests that can be reused to write integration tests for other resources. This is documented in the diff --git a/Source/en-US/DscResource.AnalyzerRules.psd1 b/Source/en-US/DscResource.AnalyzerRules.psd1 index b1fae08..584d821 100644 --- a/Source/en-US/DscResource.AnalyzerRules.psd1 +++ b/Source/en-US/DscResource.AnalyzerRules.psd1 @@ -1,47 +1,47 @@ ConvertFrom-StringData @' # English strings -ParameterBlockParameterAttributeMissing = A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block -ParameterBlockParameterAttributeLowerCase = The [Parameter()] attribute must start with an upper case 'P'. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block -ParameterBlockParameterAttributeWrongPlace = The [Parameter()] attribute must be the first attribute of each parameter. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block -ParameterBlockParameterMandatoryAttributeWrongFormat = Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block -ParameterBlockNonMandatoryParameterMandatoryAttributeWrongFormat = Non-mandatory parameters must use the correct format [Parameter()] for the parameter attribute. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block -FunctionOpeningBraceNotOnSameLine = Functions should not have the open brace on the same line as the function name. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -FunctionOpeningBraceShouldBeFollowedByNewLine = Opening brace on function should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -FunctionOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on functions should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -StatementsContainsUpperCaseLetter = '{0}' statements should not contain upper case letters See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-keywords -IfStatementOpeningBraceNotOnSameLine = If-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -IfStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on if-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -IfStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on if-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -ForEachStatementOpeningBraceNotOnSameLine = Foreach-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -ForEachStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on foreach-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -ForEachStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on foreach-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -DoUntilStatementOpeningBraceNotOnSameLine = DoUntil-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -DoUntilStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on DoUntil-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -DoUntilStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on DoUntil-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -DoWhileStatementOpeningBraceNotOnSameLine = DoWhile-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -DoWhileStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on DoWhile-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -DoWhileStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on DoWhile-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -WhileStatementOpeningBraceNotOnSameLine = While-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -WhileStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on while-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -WhileStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on while-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -ForStatementOpeningBraceNotOnSameLine = For-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -ForStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on for-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -ForStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on for-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -SwitchStatementOpeningBraceNotOnSameLine = Switch-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -SwitchStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on switch-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -SwitchStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on switch-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -TryStatementOpeningBraceNotOnSameLine = Try-statements should not have the open brace on the same line as the statement. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -TryStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on try-statements should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -TryStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on try-statements should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -CatchClauseOpeningBraceNotOnSameLine = Catch-clause should not have the open brace on the same line as the clause. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -CatchClauseOpeningBraceShouldBeFollowedByNewLine = Opening brace on catch-clause should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -CatchClauseOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on catch-clause should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -EnumOpeningBraceNotOnSameLine = Enum should not have the open brace on the same line as the declaration. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -EnumOpeningBraceShouldBeFollowedByNewLine = Opening brace on Enum should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -EnumOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on Enum should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -ClassOpeningBraceNotOnSameLine = Class should not have the open brace on the same line as the declaration. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-before-braces -ClassOpeningBraceShouldBeFollowedByNewLine = Opening brace on Class should be followed by a new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -ClassOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on Class should only be followed by one new line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -OneSpaceBetweenKeywordAndParenthesis = If a keyword is followed by a parenthesis, there should be single space between the keyword and the parenthesis. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#one-newline-after-opening-brace -HashtableShouldHaveCorrectFormat = Hashtable is not correctly formatted. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-hashtables-or-objects +ParameterBlockParameterAttributeMissing = A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block +ParameterBlockParameterAttributeLowerCase = The [Parameter()] attribute must start with an upper case 'P'. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block +ParameterBlockParameterAttributeWrongPlace = The [Parameter()] attribute must be the first attribute of each parameter. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block +ParameterBlockParameterMandatoryAttributeWrongFormat = Mandatory parameters must use the correct format [Parameter(Mandatory = $true)] for the mandatory attribute. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block +ParameterBlockNonMandatoryParameterMandatoryAttributeWrongFormat = Non-mandatory parameters must use the correct format [Parameter()] for the parameter attribute. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block +FunctionOpeningBraceNotOnSameLine = Functions should not have the open brace on the same line as the function name. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +FunctionOpeningBraceShouldBeFollowedByNewLine = Opening brace on function should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +FunctionOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on functions should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +StatementsContainsUpperCaseLetter = '{0}' statements should not contain upper case letters See https://dsccommunity.org/styleguidelines/general/#correct-format-for-keywords +IfStatementOpeningBraceNotOnSameLine = If-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +IfStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on if-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +IfStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on if-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +ForEachStatementOpeningBraceNotOnSameLine = Foreach-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +ForEachStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on foreach-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +ForEachStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on foreach-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +DoUntilStatementOpeningBraceNotOnSameLine = DoUntil-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +DoUntilStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on DoUntil-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +DoUntilStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on DoUntil-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +DoWhileStatementOpeningBraceNotOnSameLine = DoWhile-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +DoWhileStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on DoWhile-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +DoWhileStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on DoWhile-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +WhileStatementOpeningBraceNotOnSameLine = While-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +WhileStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on while-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +WhileStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on while-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +ForStatementOpeningBraceNotOnSameLine = For-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +ForStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on for-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +ForStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on for-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +SwitchStatementOpeningBraceNotOnSameLine = Switch-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +SwitchStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on switch-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +SwitchStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on switch-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +TryStatementOpeningBraceNotOnSameLine = Try-statements should not have the open brace on the same line as the statement. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +TryStatementOpeningBraceShouldBeFollowedByNewLine = Opening brace on try-statements should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +TryStatementOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on try-statements should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +CatchClauseOpeningBraceNotOnSameLine = Catch-clause should not have the open brace on the same line as the clause. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +CatchClauseOpeningBraceShouldBeFollowedByNewLine = Opening brace on catch-clause should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +CatchClauseOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on catch-clause should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +EnumOpeningBraceNotOnSameLine = Enum should not have the open brace on the same line as the declaration. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +EnumOpeningBraceShouldBeFollowedByNewLine = Opening brace on Enum should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +EnumOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on Enum should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +ClassOpeningBraceNotOnSameLine = Class should not have the open brace on the same line as the declaration. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-before-braces +ClassOpeningBraceShouldBeFollowedByNewLine = Opening brace on Class should be followed by a new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +ClassOpeningBraceShouldBeFollowedByOnlyOneNewLine = Opening brace on Class should only be followed by one new line. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +OneSpaceBetweenKeywordAndParenthesis = If a keyword is followed by a parenthesis, there should be single space between the keyword and the parenthesis. See https://dsccommunity.org/styleguidelines/whitespace/#one-newline-after-opening-brace +HashtableShouldHaveCorrectFormat = Hashtable is not correctly formatted. See https://dsccommunity.org/styleguidelines/general/#correct-format-for-hashtables-or-objects '@ diff --git a/tests/Unit/Private/Get-LocalizedData.Tests.ps1 b/tests/Unit/Private/Get-LocalizedData.Tests.ps1 index d703b89..79899f1 100644 --- a/tests/Unit/Private/Get-LocalizedData.Tests.ps1 +++ b/tests/Unit/Private/Get-LocalizedData.Tests.ps1 @@ -15,7 +15,7 @@ InModuleScope $ProjectName { $null = " ConvertFrom-StringData @`' # English strings - ParameterBlockParameterAttributeMissing = A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block + ParameterBlockParameterAttributeMissing = A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block '@ " | Out-File -Force -FilePath 'TestDrive:\ar-SA\Strings.psd1' "Get-LocalizedData -FileName 'Strings' -EA Stop" | @@ -36,7 +36,7 @@ InModuleScope $ProjectName { $null = " ConvertFrom-StringData @`' # ar-SA strings -ParameterBlockParameterAttributeMissing = A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://github.com/PowerShell/DscResources/blob/master/StyleGuidelines.md#correct-format-for-parameter-block +ParameterBlockParameterAttributeMissing = A [Parameter()] attribute must be the first attribute of each parameter and be on its own line. See https://dsccommunity.org/styleguidelines/parameters/#correct-format-for-parameter-block '@ " | Out-File -Force -FilePath 'TestDrive:\ar-SA\Strings.psd1' "Get-LocalizedData -FileName 'Strings' -DefaultUICulture 'ar-SA' -EA Stop" |