GeezerVison is showing github.com — Added rule: AvoidLongLines by thomasrayner · Pull Request #1329 · PowerShell/PSScriptAnalyzer
Conversation
PR Summary
Addresses #1243. This rule issues a warning for lines that are longer than 120 characters. This default value can be override and the rule is not enabled by default.
PR Checklist
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
rjmholt reacted with thumbs up emoji
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks but running this rule by default will break a lot of people.
The rule should be disabled by default and the width should also be configurable. Have a look at rules that inherit from ConfigurableRule for that.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
The 2 tests need fixing:
The first one is trivial, the expectation can be changed to 59 due to the new rule (maybe we can add some better logic to automatically determine the number of total rules to avoid having to update this test every time...):
[-] get Rules with no parameters supplied 60ms
Expected 58, but got 59.
74: $defaultRules.Count | Should -Be $expectedNumRules
at , C:\projects\psscriptanalyzer\Tests\Engine\GetScriptAnalyzerRule.tests.ps1: line 74
[+] is a positional parameter 14ms
Context When used incorrectly
The second test is for the documentation to have a matching rule document for every rule. Somehow it does not find the PSAvoidLongLines rules. It uses Get-ScriptAnalyzerRule for that, check if the rule gets returned here or maybe it is simply missing the PS prefix in the name?
[-] Every rule must have an entry in the rule documentation README.md file 26ms
Expected $null or empty, but got PSAvoidLongLines.
46: $rulesReadmeDiff | Where-Object SideIndicator -eq "<=" | Foreach-Object InputObject | Should -BeNullOrEmpty
at , C:\projects\psscriptanalyzer\Tests\Documentation\RuleDocumentation.tests.ps1: line 46
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I've just pushed a fix for the 2 tests and pulled from master. This should make everything green now. Will add some docs and then we should be ready to go.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
+1 more reviewer
Reviewers whose approvals may not affect merge requirements
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|