target py3.9
This commit is contained in:
parent
2a4026212d
commit
ff2a2a01da
2 changed files with 5 additions and 4 deletions
5
main.py
5
main.py
|
@ -1,6 +1,7 @@
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from typing import Union
|
||||||
|
|
||||||
from src.errors import ClangError
|
from src.errors import ClangError
|
||||||
|
|
||||||
|
@ -23,10 +24,10 @@ def clang_format(file_path):
|
||||||
return output
|
return output
|
||||||
|
|
||||||
|
|
||||||
def parse_clang_format_output(output) -> None | list[ClangError]:
|
def parse_clang_format_output(output) -> Union[None, list[ClangError]]:
|
||||||
error_pattern = (
|
error_pattern = (
|
||||||
r"(?P<filename>.+):(?P<line_number>\d+):(?P<column_number>\d+):"
|
r"(?P<filename>.+):(?P<line_number>\d+):(?P<column_number>\d+):"
|
||||||
+ r" warning: code should be clang-formatted \[(?P<warning_message>.+)\]"
|
r" warning: code should be clang-formatted \[(?P<warning_message>.+)\]"
|
||||||
)
|
)
|
||||||
error_matches = re.finditer(error_pattern, output)
|
error_matches = re.finditer(error_pattern, output)
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format
|
# https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format
|
||||||
[tool.black]
|
[tool.black]
|
||||||
target-version = ["py311"]
|
target-version = ["py39"]
|
||||||
|
|
||||||
# https://beta.ruff.rs/docs/settings/
|
# https://beta.ruff.rs/docs/settings/
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py311"
|
target-version = "py39"
|
||||||
extend-select = ["I"] # enable isort extension
|
extend-select = ["I"] # enable isort extension
|
||||||
|
|
Reference in a new issue