Skip to content

Trailing whitespace in errors #89979

Open
@wooster0

Description

@wooster0

While working on #89963 I had some issues with my editor automatically trimming trailing whitespace on save when I edited .stderr files so I had to disable that. I don't think any errors should contain trailing whitespace in the first place though. If you search the codebase with regex ^ \| $ you will find tons of such cases.

image

I have the slight feeling that whitespace might just originate from only a single location somewhere in the error printing code so perhaps this is an easy fix and thus probably worth fixing.
A pattern I noticed is that the trailing whitespace pretty much always seems to come at the end of a help: suggestion.

To be fair there's far more whitespace though. If you put src/**/*.stderr in files to include and use \s$ as the regex, you will find even more.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions