Skip to content

Commit

Permalink
build: sort.py: quote diff lines (#6594)
Browse files Browse the repository at this point in the history
To make it clearer when only whitespace was fixed on a given line.

Before:

    $ printf 'private-bin a,b \n' >foo.profile
    $ ./contrib/sort.py -n foo.profile
    sort.py: checking 1 profile(s)...
    foo.profile:1:-private-bin a,b
    foo.profile:1:+private-bin a,b

After:

    $ printf 'private-bin a,b \n' >foo.profile
    $ ./contrib/sort.py -n foo.profile
    sort.py: checking 1 profile(s)...
    foo.profile:1:-'private-bin a,b '
    foo.profile:1:+'private-bin a,b'

See commit 53ff8e0 ("build: sort.py: strip trailing whitespace in all
lines", 2024-11-26) / PR #6556.
  • Loading branch information
kmk3 authored Dec 29, 2024
1 parent c222b7f commit df6620c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contrib/sort.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ def check_profile(filename, overwrite):
if line != original_line:
was_fixed = True
print(
f"{filename}:{lineno}:-{original_line}\n"
f"{filename}:{lineno}:+{line}"
f"{filename}:{lineno}:-'{original_line}'\n"
f"{filename}:{lineno}:+'{line}'"
)
fixed_profile.append(line)

Expand Down

0 comments on commit df6620c

Please sign in to comment.