diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index eb538d8..90b2521 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -71,6 +71,10 @@ repos: rev: v2.3.1 hooks: - id: autoflake + - repo: https://github.com/MarcoGorelli/auto-walrus + rev: 0.3.4 + hooks: + - id: auto-walrus - repo: https://github.com/jumanjihouse/pre-commit-hooks rev: 3.0.0 hooks: diff --git a/dev_tools/check_jira_reference_in_todo.py b/dev_tools/check_jira_reference_in_todo.py index a82da69..10c9482 100644 --- a/dev_tools/check_jira_reference_in_todo.py +++ b/dev_tools/check_jira_reference_in_todo.py @@ -29,9 +29,7 @@ def find_files_with_incorrect_jira_reference_in_todo(files: List[Path]) -> List[ def has_any_file_incorrect_jira_reference_in_todo(files: List[Path]) -> bool: - incorrect_files = find_files_with_incorrect_jira_reference_in_todo(files) - - if incorrect_files: + if incorrect_files := find_files_with_incorrect_jira_reference_in_todo(files): print("\nThe following TODOs do not correspond to the JIRA-Ticket TODO format 'TODO(ABC-1234):':") for file in incorrect_files: print(f"{file['file_path']}:{file['line_number']}: error: '{file['line_content']}'")