Skip to content

Commit

Permalink
Second minor bugfix to alphabetize-codeowners
Browse files Browse the repository at this point in the history
Trailing "\n" was picked up on whitespace splitting and created "" as
an "owner" string.
  • Loading branch information
sirosen committed Oct 17, 2023
1 parent f78bb10 commit 3c4a830
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ following sample config:
### Unreleased

<!-- bumpversion-changelog -->
- Minor whitespace bugfix for `alphabetize-codeowners`

### 0.6.1

Expand Down
2 changes: 1 addition & 1 deletion src/texthooks/alphabetize_codeowners.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3c4a830

Please sign in to comment.