Skip to content

Commit

Permalink
Linter
Browse files Browse the repository at this point in the history
  • Loading branch information
justinchuby committed Oct 17, 2023
1 parent 2bdef99 commit 10d4b7d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lintrunner_adapters/adapters/requirements_txt_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ def __lt__(self, requirement: Requirement) -> bool:
assert self.value is not None, self.value
if self.value == b"\n":
return True
elif requirement.value == b"\n":
if requirement.value == b"\n":
return False
else:
return self.name < requirement.name
return self.name < requirement.name

def is_complete(self) -> bool:
return self.value is not None and not self.value.rstrip(b"\r\n").endswith(b"\\")
Expand Down Expand Up @@ -80,7 +79,7 @@ def fix_requirements(f: IO[bytes]) -> bytes:
# If the most recent requirement object has a value, then it's
# time to start building the next requirement object.

if not len(requirements) or requirements[-1].is_complete():
if not requirements or requirements[-1].is_complete():
requirements.append(Requirement())

requirement = requirements[-1]
Expand Down

0 comments on commit 10d4b7d

Please sign in to comment.