Fix broken links to old .md files, set correct root directory for Get-RuleDocumentationPath function#1730
Fix broken links to old .md files, set correct root directory for Get-RuleDocumentationPath function#1730fabge wants to merge 4 commits intoPowerShell:masterfrom fabge:fix-broken-links
Conversation
…-RuleDocumentationPath function
andyleejordan
left a comment
There was a problem hiding this comment.
Great catch! One more extension to fix (I think).
PowerShellBestPractices.md
Outdated
| - Must call ShouldProcess when ShouldProcess attribute is present and vice versa.[UseShouldProcess](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/RuleDocumentation/ShouldProcess.md) | ||
| - Nouns should be singular [UseSingularNouns](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/RuleDocumentation/UseSingularNouns.md) | ||
| - Module Manifest Fields [MissingModuleManifestField](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/RuleDocumentation/MissingModuleManifestField.md) | ||
| - Use Only Approved Verbs [UseApprovedVerbs](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/Rules/UseApprovedVerbs.cs) |
There was a problem hiding this comment.
The new links here will link to the source code. Instead they should link to the rule documentation, which looks like it now lives under https://github.com/PowerShell/PSScriptAnalyzer/tree/master/docs/Rules
There was a problem hiding this comment.
Rob is right, the .cs are transformed into .md into the confusingly similarly named docs/Rules folder (instead of just Rules) found here: https://github.com/PowerShell/PSScriptAnalyzer/tree/master/docs/Rules
So, the links are still broken as-is, but the fix is different. Keep the .md extension, but point to docs/Rules/ instead of RuleDocumentation/ (or Rules/ as in this first iteration).
It used to be |
|
Thanks for the feedback. I pushed a new commit, changing the filepaths to the Markdown files under docs/Rules. |
| - No Invoke-Expression [AvoidUsingInvokeExpression](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/Rules/AvoidUsingInvokeExpression.cs) | ||
| - Avoid using alias [AvoidAlias](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidAlias.md) #TODO not found | ||
| - Avoid using deprecated WMI cmdlets [AvoidUsingWMICmdlet](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingWMICmdlet.md) | ||
| - Empty catch block should not be used [AvoidEmptyCatchBlock](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingEmptyCatchBlock.md) |
There was a problem hiding this comment.
| - Empty catch block should not be used [AvoidEmptyCatchBlock](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingEmptyCatchBlock.md) | |
| - Empty catch block should not be used [AvoidUsingEmptyCatchBlock](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingEmptyCatchBlock.md) |
| - Empty catch block should not be used [AvoidEmptyCatchBlock](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingEmptyCatchBlock.md) | ||
| - Invoke existing cmdlet with correct parameters [UseCmdletCorrectly](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/UseCmdletCorrectly.md) | ||
| - Cmdlets should have ShouldProcess/ShouldContinue and Force param if certain system-modding verbs are present (Update, Set, Remove, New): [UseShouldProcessForStateChangingFunctions](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/UseShouldProcessForStateChangingFunctions.md) | ||
| - Positional parameters should be avoided [AvoidPositionalParameters](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingPositionalParameters.md) |
There was a problem hiding this comment.
| - Positional parameters should be avoided [AvoidPositionalParameters](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingPositionalParameters.md) | |
| - Positional parameters should be avoided [AvoidUsingPositionalParameters](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingPositionalParameters.md) |
| ### Severity: Warning | ||
|
|
||
| - Password = 'string' should not be used. (information disclosure) [AvoidUserNameAndPasswordParams](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/Rules/AvoidUserNameAndPasswordParams.cs) | ||
| - Password = 'string' should not be used. (information disclosure) [AvoidUserNameAndPasswordParams](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingUsernameAndPasswordParams.md) |
There was a problem hiding this comment.
| - Password = 'string' should not be used. (information disclosure) [AvoidUserNameAndPasswordParams](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingUsernameAndPasswordParams.md) | |
| - Password = 'string' should not be used. (information disclosure) [AvoidUsingUserNameAndPasswordParams](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingUsernameAndPasswordParams.md) |
| - Global variables should be avoided. [AvoidGlobalVars](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/Rules/AvoidGlobalVars.cs) | ||
| - Declared variables must be used in more than just their assignment. [UseDeclaredVarsMoreThanAssignments](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/Rules/UseDeclaredVarsMoreThanAssignments.cs) | ||
| - No Invoke-Expression [AvoidUsingInvokeExpression](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/Rules/AvoidUsingInvokeExpression.cs) | ||
| - Avoid using alias [AvoidAlias](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidAlias.md) #TODO not found |
There was a problem hiding this comment.
| - Avoid using alias [AvoidAlias](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidAlias.md) #TODO not found | |
| - Avoid using cmdlet aliases [AvoidUsingCmdletAliases](https://github.com/PowerShell/PSScriptAnalyzer/blob/master/docs/Rules/AvoidUsingCmdletAliases.md) |
I looked through the Git history and this was renamed in 11a04a9
bergmeister
left a comment
There was a problem hiding this comment.
LGTM, I resolved the merge conflict, please check you are happy with it. Can you give it a final review @sdwheeler and @andschwa please?
|
Just a note about this article. This has been migrated to https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules-recommendations. It is scheduled to be deleted from the source repo in a month. |
|
Guys, can you either merge or reject? I'd like this closed... |
|
@SydneyhSmith and @JamesWTruher we need to triage / merge this! |
|
To me it sounds like we can close it since it's moved to an upstream source and the files here will vanish soon. Do you agree @sdwheeler ? |
|
@bergmeister I agree. However, there is still the change to Utils/RuleMaker.psm1 that needs to be made. If we merge this then we get that change. The other doc will be delete in a month so the changes to it can be merged as is. The doc is already published to the live site at https://docs.microsoft.com/powershell/utility-modules/psscriptanalyzer/rules-recommendations. So the broken links are not an issue. |
PR Summary
There were still links to the old "RuleDocumentation" folder and some files were renamed.
The root directory if the
Get-RuleDocumentationPathfunction was also set to the "Rules" folderPR Checklist
.cs,.ps1and.psm1files have the correct copyright headerWIP:to the beginning of the title and remove the prefix when the PR is ready.