Skip to content

Commit

Permalink
check-style: Fix f-string issue in Python 3.9 and earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
edalm committed Oct 19, 2024
1 parent fea4226 commit fe6304e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions utils/check-style-clang-format.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ def check_encoding_file(
[
f"{filename}:{line_number + 1}:{bad_char_column + 1}: error: bad {FILE_ENCODING} encoding",
f" {line.rstrip()}",
f" {'':{bad_char_column}}^",
f" {'':>{bad_char_column}}^",
]
)

Expand Down Expand Up @@ -688,7 +688,7 @@ def check_include_prefixes_line(
[
f'{filename}:{line_number + 1}:{header_index + 1}: error: #include headers from the same module with the "ns3/" prefix detected',
f" {line_stripped}",
f' {"":{header_index}}^',
f" {'':>{header_index}}^",
]
)

Expand Down Expand Up @@ -722,7 +722,7 @@ def check_whitespace_line(
verbose_infos = [
f"{filename}:{line_number + 1}:{len(line_fixed_stripped_expanded) + 1}: error: Trailing whitespace detected",
f" {line_fixed_stripped_expanded}",
f' {"":{len(line_fixed_stripped_expanded)}}^',
f" {'':>{len(line_fixed_stripped_expanded)}}^",
]

return (is_line_compliant, line_fixed, verbose_infos)
Expand Down Expand Up @@ -757,7 +757,7 @@ def check_tabs_line(
verbose_infos = [
f"{filename}:{line_number + 1}:{tab_index + 1}: error: Tab detected",
f" {line.rstrip()}",
f' {"":{tab_index}}^',
f" {'':>{tab_index}}^",
]

return (is_line_compliant, line_fixed, verbose_infos)
Expand Down Expand Up @@ -820,7 +820,7 @@ def check_licenses_line(
[
f"{filename}:{line_number + 1}:{col_index}: error: GPL license text detected instead of SPDX license",
f" {line_stripped}",
f' {"":{col_index}}^',
f" {'':>{col_index}}^",
]
)

Expand Down

0 comments on commit fe6304e

Please sign in to comment.