mirror of
https://github.com/pre-commit/pre-commit-hooks.git
synced 2026-04-04 11:16:53 +00:00
requirements-txt-fixer now supports indents before comments
This commit is contained in:
parent
a6add1c672
commit
28b2c8e431
2 changed files with 11 additions and 1 deletions
|
|
@ -95,7 +95,7 @@ def fix_requirements(f: IO[bytes]) -> int:
|
|||
requirement.value = b'\n'
|
||||
else:
|
||||
requirement.comments.append(line)
|
||||
elif line.startswith(b'#') or line.strip() == b'':
|
||||
elif line.lstrip().startswith(b'#') or line.strip() == b'':
|
||||
requirement.comments.append(line)
|
||||
else:
|
||||
requirement.append_value(line)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue