PowerShell / PowerShell/PSScriptAnalyzer

Documentation for AvoidTrailingWhitespace shouldn't use bad practices for reasoning

Open
#1,034 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area - Documentation Issue - Discussion
Dominant language
C#
Stars
2.2k
Forks
414
Avg merge
13h 1m
Merged PRs (30d)
2

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Open RuleDocumentation/AvoidTrailingWhitespace.md and review the quoted explanation of trailing whitespace and the backtick character. Decide which of the three wording changes best matches the project’s documentation guidance, update that passage, and verify that it accurately describes the practice without treating backticks as line-continuation characters.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.