Formatter: Remove trailing whitespace from comments

Fixes #153
This commit is contained in:
Alexey Yerin 2025-01-04 17:15:14 +03:00 committed by James Westman
parent 8c6f8760f7
commit 29e4a56bfc
3 changed files with 8 additions and 1 deletions

View file

@ -193,6 +193,9 @@ def format(data, tab_size=2, insert_space=True):
elif prev_line_type in require_extra_newline:
newlines = 2
current_line = "\n".join(
[line.rstrip() for line in current_line.split("\n")]
)
commit_current_line(LineType.COMMENT, newlines_before=newlines)
else: # pragma: no cover

View file

@ -1,2 +1,4 @@
using Gtk 4.0;
//comment
//comment
// Trailing whitespace:
//

View file

@ -1,2 +1,4 @@
using Gtk 4.0;
// comment
// Trailing whitespace:
//