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

Fixes #1722 - Update cmdlet docs for 1.20.0 #1726

Merged
merged 3 commits into from
Oct 12, 2021

Conversation

sdwheeler
Copy link
Collaborator

PR Summary

Fixes #1722 - Prepare cmdlet reference for publication on docs.microsoft.com

  • Updated content accuracy for 1.20.0
  • Fixed formatting to conform to docs standards
  • Created PSScriptAnalyzer.md, which is required for the docs platform

PR Checklist

@rjmholt
Copy link
Contributor

rjmholt commented Oct 7, 2021

Looks like cmdlet help tests are failing:

##[error] [-] Cmdlet help.gets example help from  21ms (18ms|2ms)
##[error]  Expected a value, but got $null or empty.
##[error]  at ($Help.Examples.Example.Remarks | Select-Object -First 1).Text | Should -Not -BeNullOrEmpty, /home/vsts/work/1/s/Tests/Engine/ModuleHelp.Tests.ps1:121
##[error]  at <ScriptBlock>, /home/vsts/work/1/s/Tests/Engine/ModuleHelp.Tests.ps1:121
##[error] [-] Cmdlet help.gets example help from  9ms (7ms|2ms)
##[error]  Expected a value, but got $null or empty.
##[error]  at ($Help.Examples.Example.Remarks | Select-Object -First 1).Text | Should -Not -BeNullOrEmpty, /home/vsts/work/1/s/Tests/Engine/ModuleHelp.Tests.ps1:121
##[error]  at <ScriptBlock>, /home/vsts/work/1/s/Tests/Engine/ModuleHelp.Tests.ps1:121
##[error] [-] Cmdlet help.gets example help from  8ms (7ms|2ms)
##[error]  Expected a value, but got $null or empty.
##[error]  at ($Help.Examples.Example.Remarks | Select-Object -First 1).Text | Should -Not -BeNullOrEmpty, /home/vsts/work/1/s/Tests/Engine/ModuleHelp.Tests.ps1:121
##[error]  at <ScriptBlock>, /home/vsts/work/1/s/Tests/Engine/ModuleHelp.Tests.ps1:121

@sdwheeler
Copy link
Collaborator Author

@rjmholt I checked to see if there were tests. I couldn't find them. I will take another look and fix them.

@sdwheeler
Copy link
Collaborator Author

@rjmholt I removed the test for Remarks in the example. Remarks are optional. The only thing we need to validate is that there is a code block in the example.

Comment on lines -118 to -122

# Should be at least one example description
It "gets example help from $commandName" -TestCases $testCases {
($Help.Examples.Example.Remarks | Select-Object -First 1).Text | Should -Not -BeNullOrEmpty
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're better off not removing tests like this if we can avoid it — it's a nice bar on doc quality that we require examples.

If docs are just being updated, what caused this to fail?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I wouldn't normally want to remove a test but the Remarks are optional.

The test broke because the Remarks were moved. In some cases, the Remark was incorporated into the Example title. In others it was move before the code block as an intro.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For higher quality, we should be testing the following:

  • every parameter of a cmdlet exists in the markdown
  • each parameter has description
  • the markdown does not contain any parameters that the cmdlet doesn't have

@rjmholt rjmholt merged commit b063f90 into PowerShell:master Oct 12, 2021
@sdwheeler sdwheeler deleted the sdw-i1722 branch May 23, 2022 18:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit cmdlet reference to prepare for publishing on docs platform
2 participants