Skip to content

Commit

Permalink
Merge pull request #11 from andrewrdavidson/release-1.0.9
Browse files Browse the repository at this point in the history
Fix help comments and other minor fixes
  • Loading branch information
andrewrdavidson authored Dec 29, 2020
2 parents 1f6ea9a + 2671dab commit 5e85934
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 28 deletions.
2 changes: 1 addition & 1 deletion PSQualityCheck.Functions.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSQualityCheck.Functions.psm1'

# Version number of this module.
ModuleVersion = '1.0.8'
ModuleVersion = '1.0.9'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
26 changes: 14 additions & 12 deletions PSQualityCheck.Functions.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ function Export-FunctionsFromModule {
A string Path containing the full path to the extraction folder
.EXAMPLE
Export-FunctionsFromModule -Path 'c:\path.to\module.psm1' -FunctionExtractionPath 'c:\extract'
Export-FunctionsFromModule -Path 'c:\path.to\module.psm1' -FunctionExtractPath 'c:\extract'
#>
[CmdletBinding()]
[OutputType([System.Void])]
Expand Down Expand Up @@ -346,7 +346,7 @@ function Get-FileList {
$files = Get-FileList -Path 'c:\folder' -Extension ".ps1"
#>
[CmdletBinding()]
[OutputType([System.String[]])]
[OutputType([System.Object[]])]
param (
[parameter(Mandatory = $true)]
[string]$Path,
Expand Down Expand Up @@ -387,7 +387,7 @@ function Get-FunctionCount {
A string containing the Manifest filename
.EXAMPLE
($ExportedCommandsCount, $CommandFoundInModuleCount, $CommandInModuleCount, $CommandFoundInManifestCount) = Get-FunctionCount -Module $moduleFile -Manifest $manifestFile
($ExportedCommandsCount, $CommandFoundInModuleCount, $CommandInModuleCount, $CommandFoundInManifestCount) = Get-FunctionCount -ModuleFile $moduleFile -ManifestFile $manifestFile
#>
[CmdletBinding()]
Expand All @@ -401,7 +401,8 @@ function Get-FunctionCount {

try {
if (Test-Path -Path $ManifestFile) {
$ExportedCommandsCount = (Test-ModuleManifest -Path $ManifestFile).ExportedCommands.Count
$ExportedCommands = (Test-ModuleManifest -Path $ManifestFile -ErrorAction Stop).ExportedCommands
$ExportedCommandsCount = $ExportedCommands.Count
}
else {
throw "Manifest file doesn't exist"
Expand All @@ -411,6 +412,7 @@ function Get-FunctionCount {
$ExportedCommands = @()
$ExportedCommandsCount = 0
}

try {
if (Test-Path -Path $ModuleFile) {
($ParsedModule, $ParserErrors) = Get-ParsedFile -Path $ModuleFile
Expand Down Expand Up @@ -453,10 +455,10 @@ function Get-FunctionCount {

if ($ExportedCommandsCount -ge 1) {

$functionNames | ForEach-Object {
foreach ($function in $functionNames) {

$CommandInModuleCount++
if ($ExportedCommands.ContainsKey($_.Content)) {
if ($ExportedCommands.ContainsKey($function.Content)) {

$CommandFoundInManifestCount++

Expand Down Expand Up @@ -746,7 +748,7 @@ function Test-HelpForRequiredTokens {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpForRequiredTokens -HelpComment $helpComment
Test-HelpForRequiredTokens -HelpTokens $HelpTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down Expand Up @@ -813,7 +815,7 @@ function Test-HelpForUnspecifiedTokens {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpForUnspecifiedTokens -HelpComment $helpComment
Test-HelpForUnspecifiedTokens -HelpTokens $HelpTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down Expand Up @@ -885,7 +887,7 @@ function Test-HelpTokensCountIsValid {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpTokensCountIsValid -HelpComment $helpComment
Test-HelpTokensCountIsValid -HelpTokens $HelpTokens
.NOTES
This function will only check the Min/Max counts of required help tokens
Expand Down Expand Up @@ -980,7 +982,7 @@ function Test-HelpTokensParamsMatch {
A object containing the parameters from the param block
.EXAMPLE
Test-HelpTokensParamsMatch -HelpComment $helpComment -ParameterVariables $ParameterVariables
Test-HelpTokensParamsMatch -HelpTokens $HelpTokens -ParameterVariables $ParameterVariables
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.String[]])]
Expand Down Expand Up @@ -1074,7 +1076,7 @@ function Test-HelpTokensTextIsValid {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpTokensTextIsValid -HelpComment $helpComment
Test-HelpTokensTextIsValid -HelpTokens $HelpTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down Expand Up @@ -1134,7 +1136,7 @@ function Test-ImportModuleIsValid {
An object containing the Import-Module calls found
.EXAMPLE
TestImportModuleIsValid -ParsedFile $parsedFile
TestImportModuleIsValid -ParsedFile $parsedFile -ImportModuleTokens $importModuleTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down
2 changes: 1 addition & 1 deletion PSQualityCheck.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'PSQualityCheck.psm1'

# Version number of this module.
ModuleVersion = '1.0.8'
ModuleVersion = '1.0.9'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
2 changes: 1 addition & 1 deletion Source/Build.Properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"HelpInfoURI": "https://github.com/andrewrdavidson/PSQualityCheck/wiki",
"LicenseUri": "https://github.com/andrewrdavidson/PSQualityCheck/blob/main/LICENSE",
"ModuleVersion": "1.0.8",
"ModuleVersion": "1.0.9",
"NestedModules": {
"PSQualityCheck": "PSQualityCheck.Functions.psd1",
"PSQualityCheck.Functions": null
Expand Down
11 changes: 10 additions & 1 deletion Source/Invoke-Build.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<#
.SYNOPSIS
Build the PSQualityCheck modules
.DESCRIPTION
Builds the PSQualityCheck and PSQualityCheck.Functions modules and generates new manifest files
.EXAMPLE
Invoke-Build.ps1
#>
[CmdletBinding()]
[OutputType([System.Void])]
param (
Expand Down Expand Up @@ -83,7 +93,6 @@ foreach ($folder in $sourceScriptFolders) {

NestedModules = $buildProperties.NestedModules.($folder.Name)


}

New-ModuleManifest @newModuleManifest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Export-FunctionsFromModule {
A string Path containing the full path to the extraction folder
.EXAMPLE
Export-FunctionsFromModule -Path 'c:\path.to\module.psm1' -FunctionExtractionPath 'c:\extract'
Export-FunctionsFromModule -Path 'c:\path.to\module.psm1' -FunctionExtractPath 'c:\extract'
#>
[CmdletBinding()]
[OutputType([System.Void])]
Expand Down
2 changes: 1 addition & 1 deletion Source/PSQualityCheck.Functions/Get-FileList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function Get-FileList {
$files = Get-FileList -Path 'c:\folder' -Extension ".ps1"
#>
[CmdletBinding()]
[OutputType([System.String[]])]
[OutputType([System.Object[]])]
param (
[parameter(Mandatory = $true)]
[string]$Path,
Expand Down
10 changes: 6 additions & 4 deletions Source/PSQualityCheck.Functions/Get-FunctionCount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Get-FunctionCount {
A string containing the Manifest filename
.EXAMPLE
($ExportedCommandsCount, $CommandFoundInModuleCount, $CommandInModuleCount, $CommandFoundInManifestCount) = Get-FunctionCount -Module $moduleFile -Manifest $manifestFile
($ExportedCommandsCount, $CommandFoundInModuleCount, $CommandInModuleCount, $CommandFoundInManifestCount) = Get-FunctionCount -ModuleFile $moduleFile -ManifestFile $manifestFile
#>
[CmdletBinding()]
Expand All @@ -28,7 +28,8 @@ function Get-FunctionCount {

try {
if (Test-Path -Path $ManifestFile) {
$ExportedCommandsCount = (Test-ModuleManifest -Path $ManifestFile).ExportedCommands.Count
$ExportedCommands = (Test-ModuleManifest -Path $ManifestFile -ErrorAction Stop).ExportedCommands
$ExportedCommandsCount = $ExportedCommands.Count
}
else {
throw "Manifest file doesn't exist"
Expand All @@ -38,6 +39,7 @@ function Get-FunctionCount {
$ExportedCommands = @()
$ExportedCommandsCount = 0
}

try {
if (Test-Path -Path $ModuleFile) {
($ParsedModule, $ParserErrors) = Get-ParsedFile -Path $ModuleFile
Expand Down Expand Up @@ -80,10 +82,10 @@ function Get-FunctionCount {

if ($ExportedCommandsCount -ge 1) {

$functionNames | ForEach-Object {
foreach ($function in $functionNames) {

$CommandInModuleCount++
if ($ExportedCommands.ContainsKey($_.Content)) {
if ($ExportedCommands.ContainsKey($function.Content)) {

$CommandFoundInManifestCount++

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Test-HelpForRequiredTokens {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpForRequiredTokens -HelpComment $helpComment
Test-HelpForRequiredTokens -HelpTokens $HelpTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Test-HelpForUnspecifiedTokens {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpForUnspecifiedTokens -HelpComment $helpComment
Test-HelpForUnspecifiedTokens -HelpTokens $HelpTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Test-HelpTokensCountIsValid {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpTokensCountIsValid -HelpComment $helpComment
Test-HelpTokensCountIsValid -HelpTokens $HelpTokens
.NOTES
This function will only check the Min/Max counts of required help tokens
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Test-HelpTokensParamsMatch {
A object containing the parameters from the param block
.EXAMPLE
Test-HelpTokensParamsMatch -HelpComment $helpComment -ParameterVariables $ParameterVariables
Test-HelpTokensParamsMatch -HelpTokens $HelpTokens -ParameterVariables $ParameterVariables
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.String[]])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function Test-HelpTokensTextIsValid {
A string containing the text of the Help Comment
.EXAMPLE
Test-HelpTokensTextIsValid -HelpComment $helpComment
Test-HelpTokensTextIsValid -HelpTokens $HelpTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function Test-ImportModuleIsValid {
An object containing the Import-Module calls found
.EXAMPLE
TestImportModuleIsValid -ParsedFile $parsedFile
TestImportModuleIsValid -ParsedFile $parsedFile -ImportModuleTokens $importModuleTokens
#>
[CmdletBinding()]
[OutputType([System.Exception], [System.Void])]
Expand Down

0 comments on commit 5e85934

Please sign in to comment.