diff --git a/lintrunner_adapters/adapters/requirements_txt_linter.py b/lintrunner_adapters/adapters/requirements_txt_linter.py index 8ca1af7..0993379 100644 --- a/lintrunner_adapters/adapters/requirements_txt_linter.py +++ b/lintrunner_adapters/adapters/requirements_txt_linter.py @@ -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"\\") @@ -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]