diff --git a/main.py b/main.py index d0ac950..2772127 100644 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ import re import subprocess import sys +from typing import Union from src.errors import ClangError @@ -23,10 +24,10 @@ def clang_format(file_path): return output -def parse_clang_format_output(output) -> None | list[ClangError]: +def parse_clang_format_output(output) -> Union[None, list[ClangError]]: error_pattern = ( r"(?P.+):(?P\d+):(?P\d+):" - + r" warning: code should be clang-formatted \[(?P.+)\]" + r" warning: code should be clang-formatted \[(?P.+)\]" ) error_matches = re.finditer(error_pattern, output) diff --git a/pyproject.toml b/pyproject.toml index 5d70e2b..f4196c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ # https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format [tool.black] -target-version = ["py311"] +target-version = ["py39"] # https://beta.ruff.rs/docs/settings/ [tool.ruff] -target-version = "py311" +target-version = "py39" extend-select = ["I"] # enable isort extension