From b5b2ccf73aa07eedd91aeceb3f55e8c604a7167b Mon Sep 17 00:00:00 2001 From: "pixeebot[bot]" <104101892+pixeebot[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 13:37:11 +0000 Subject: [PATCH] Hardening suggestions for codemodder-python / req-r-lines (#417) Simplify Boolean Expressions Using `startswith` and `endswith` Co-authored-by: pixeebot[bot] <104101892+pixeebot[bot]@users.noreply.github.com> --- .../file_parsers/requirements_txt_file_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/codemodder/project_analysis/file_parsers/requirements_txt_file_parser.py b/src/codemodder/project_analysis/file_parsers/requirements_txt_file_parser.py index ea88b29b..ea966e17 100644 --- a/src/codemodder/project_analysis/file_parsers/requirements_txt_file_parser.py +++ b/src/codemodder/project_analysis/file_parsers/requirements_txt_file_parser.py @@ -48,5 +48,5 @@ def _clean_lines(self, lines: list[str]) -> set[str]: return set( line.split("#")[0].strip() for line in lines - if not (line.startswith("#") or line.startswith("-r ")) + if not line.startswith(("#", "-r ")) )