Skip to content

Space-only lines in multi-line comments #314

@sigprof

Description

@sigprof

Alejandra 1.5.0 adds spaces to all lines inside multi-line comments, including empty lines:

{
  /*
   This is a comment.
   
   This is the second paragraph of the comment.
   */
}

This may not be apparent unless you select the text, but the “empty” line in the middle of the comment actually contains 3 spaces after formatting. Such lines are considered to be suspicious by many tools (e.g., even git diff highlights them as whitespace errors).

Maybe Alejandra should leave such lines completely empty instead of adding whitespace-only lines to the code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions