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

Fix Integration Test Failures in xArchive and General Code Quality improvements - Fixes #457 #472

Merged
merged 17 commits into from
Jan 19, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
* text eol=crlf
*.exe binary
53 changes: 53 additions & 0 deletions .vscode/analyzersettings.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
@{
<#
For the custom rules to work, the DscResource.Tests repo must be
cloned. It is automatically clone as soon as any unit or
integration tests are run.
#>
CustomRulePath = '.\DSCResource.Tests\DscResource.AnalyzerRules'

IncludeRules = @(
# DSC Resource Kit style guideline rules.
'PSAvoidDefaultValueForMandatoryParameter',
'PSAvoidDefaultValueSwitchParameter',
'PSAvoidInvokingEmptyMembers',
'PSAvoidNullOrEmptyHelpMessageAttribute',
'PSAvoidUsingCmdletAliases',
'PSAvoidUsingComputerNameHardcoded',
'PSAvoidUsingDeprecatedManifestFields',
'PSAvoidUsingEmptyCatchBlock',
'PSAvoidUsingInvokeExpression',
'PSAvoidUsingPositionalParameters',
'PSAvoidShouldContinueWithoutForce',
'PSAvoidUsingWMICmdlet',
'PSAvoidUsingWriteHost',
'PSDSCReturnCorrectTypesForDSCFunctions',
'PSDSCStandardDSCFunctionsInResource',
'PSDSCUseIdenticalMandatoryParametersForDSC',
'PSDSCUseIdenticalParametersForDSC',
'PSMisleadingBacktick',
'PSMissingModuleManifestField',
'PSPossibleIncorrectComparisonWithNull',
'PSProvideCommentHelp',
'PSReservedCmdletChar',
'PSReservedParams',
'PSUseApprovedVerbs',
'PSUseCmdletCorrectly',
'PSUseOutputTypeCorrectly',
'PSAvoidGlobalVars',
'PSAvoidUsingConvertToSecureStringWithPlainText',
'PSAvoidUsingPlainTextForPassword',
'PSAvoidUsingUsernameAndPasswordParams',
'PSDSCUseVerboseMessageInDSCResource',
'PSShouldProcess',
'PSUseDeclaredVarsMoreThanAssignments',
'PSUsePSCredentialType',

<#
This is to test all the DSC Resource Kit custom rules.
The name of the function-blocks of each custom rule start
with 'Measure*'.
#>
'Measure-*'
)
}
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
"powershell.codeFormatting.ignoreOneLineBlock": false,
"powershell.codeFormatting.preset": "Custom",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true
"files.insertFinalNewline": true,
"powershell.scriptAnalysis.settingsPath": ".vscode\\analyzersettings.psd1"
}
14 changes: 8 additions & 6 deletions DSCResources/CommonResourceHelper.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#>
function Test-IsNanoServer
{
[OutputType([Boolean])]
[OutputType([System.Boolean])]
[CmdletBinding()]
param ()

Expand Down Expand Up @@ -34,13 +34,13 @@ function Test-IsNanoServer
#>
function Test-CommandExists
{
[OutputType([Boolean])]
[OutputType([System.Boolean])]
[CmdletBinding()]
param
(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
[System.String]
$Name
)

Expand All @@ -65,12 +65,12 @@ function New-InvalidArgumentException
(
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
[System.String]
$Message,

[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[String]
[System.String]
$ArgumentName
)

Expand Down Expand Up @@ -100,10 +100,12 @@ function New-InvalidOperationException
[CmdletBinding()]
param
(
[Parameter()]
[ValidateNotNullOrEmpty()]
[String]
[System.String]
$Message,

[Parameter()]
[ValidateNotNull()]
[System.Management.Automation.ErrorRecord]
$ErrorRecord
Expand Down
Loading