diff --git a/README.md b/README.md index 858b074..038360e 100644 --- a/README.md +++ b/README.md @@ -179,6 +179,7 @@ following sample config: ### Unreleased +- Minor whitespace bugfix for `alphabetize-codeowners` ### 0.6.1 diff --git a/src/texthooks/alphabetize_codeowners.py b/src/texthooks/alphabetize_codeowners.py index 442342a..b3cf9d8 100644 --- a/src/texthooks/alphabetize_codeowners.py +++ b/src/texthooks/alphabetize_codeowners.py @@ -48,7 +48,7 @@ def sort_line(line: str) -> str: if line == "" or line.strip().startswith("#"): return line # also normalizes whitespace - dedented = line.lstrip() + dedented = line.lstrip().rstrip() elements = WS_PAT.split(dedented) if len(elements) < 2: return line