PSScriptAnalyzer icon indicating copy to clipboard operation
PSScriptAnalyzer copied to clipboard

Documentation for AvoidTrailingWhitespace shouldn't use bad practices for reasoning

Open poshcodebear opened this issue 7 years ago • 1 comments

from document file /RuleDocumentation/AvoidTrailingWhitespace.md:

Lines should not end with whitespace characters. This can cause problems with the line-continuation backtick, and also clutters up future commits to source control.

The backtick character is not a "line-continuation" character and using it as such is generally considered bad practice (for the exact reason noted in this document). I feel this shouldn't be listed as a reason for avoiding trailing whitespace since it's saying you should avoid one bad practice to prevent messing with another bad practice.

I feel this should be changed to either:

  1. Not refer to the backtick character as a "line-continuation character" since that's not what it is and call out this use as bad practice
  2. Explicitly call out that the use of the backtick character as a "line-continuation character" is considered bad practice
  3. Remove the reference to the use of the backtick character in the description entirely, since this usage should be avoided in the first place

What is the latest version of PSScriptAnalyzer at the point of writing 1.17.1

poshcodebear avatar Jul 11 '18 21:07 poshcodebear

There are many, many reasons why trailing whitespace is considered a bad practice by programmers --regardless of any specific langauge-- and I don't think it's helpful to call out one specific reason here, as people may decide "well, if that's the only reason, then I don't care about this rule".

Jaykul avatar Nov 17 '20 18:11 Jaykul