Skip to content

Improve PSScriptAnalyzer #171

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

Merged
merged 29 commits into from
Sep 10, 2023
Merged

Improve PSScriptAnalyzer #171

merged 29 commits into from
Sep 10, 2023

Conversation

bravo-kernel
Copy link
Contributor

@bravo-kernel bravo-kernel commented Sep 10, 2023

  • Replace github action with powershell run command (so we can report full file paths)
  • Scan source files instead of compiled module
  • Also scan tests files from now on
  • Fix errors

@vercel
Copy link

vercel bot commented Sep 10, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docusaurus-powershell ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 10, 2023 2:43pm

@github-actions
Copy link

PSScriptAnalyzer results:

Errors: [0], Warnings: [27], Information: [0]


RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : GetCustomEditUrl.Tests.ps1
Line       : 10
Message    : The variable 'DummyMarkdownFile' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : GetCustomEditUrl.Tests.ps1
Line       : 11
Message    : The variable 'DummyModuleFile' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : HtmlEncodeLessThanBrackets.psm1
Line       : 42
Message    : The parameter 'Dummy' has been declared but not used. 

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSReviewUnusedParameter
Severity   : Warning
ScriptName : UnescapeInlineCode.psm1
Line       : 51
Message    : The parameter 'Dummy' has been declared but not used. 

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSUseSingularNouns
Severity   : Warning
ScriptName : SeparateMarkdownHeadings.psm1
Line       : 1
Message    : The cmdlet 'Test-SeparateMarkdownHeadings' uses a plural noun. A 
             singular noun should be used instead.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdxWithPlaceholders' is assigned but never 
             used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdxWithPlaceholders' is assigned but never 
             used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 24
Message    : The variable 'generatedMdxWithoutPlaceholders' is assigned but 
             never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 25
Message    : The variable 'expectedMdxWithoutPlaceholders' is assigned but 
             never used.

RuleName   : PSUseSingularNouns
Severity   : Warning
ScriptName : PlaceholderExamples.psm1
Line       : 1
Message    : The cmdlet 'Test-PlaceholderExamples' uses a plural noun. A 
             singular noun should be used instead.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 6
Message    : The variable 'isPS7' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 18
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 19
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 16
Message    : The variable 'generatedMdx' is assigned but never used.

RuleName   : PSUseDeclaredVarsMoreThanAssignments
Severity   : Warning
ScriptName : Integration.Tests.ps1
Line       : 17
Message    : The variable 'expectedMdx' is assigned but never used.

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.

1 participant