Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions archinstall/locales/locales_generator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,19 +67,9 @@ cmd_check_po_syntax() {
echo "All .po files passed syntax check."
}

cmd_check_no_tr_fstring() {
echo "Checking for tr(f-string) anti-pattern..."
if grep -rnE "tr\(\s*f['\"]" . --include='*.py'; then
echo "ERROR: use tr('...{}').format(...) instead of tr(f'...')" >&2
return 1
fi
echo "No tr(f-string) anti-pattern found."
}

cmd_check() {
local failed=0
cmd_check_po_syntax || failed=1
cmd_check_no_tr_fstring || failed=1
if [ "$failed" -eq 1 ]; then
echo "Some translation checks failed." >&2
exit 1
Expand Down
15 changes: 11 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,6 @@ indent-style = "tab"
quote-style = "single"
docstring-code-format = true

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint]
select = [
"ASYNC", # flake8-async
Expand All @@ -220,6 +217,7 @@ select = [
"G", # flake8-logging-format
"I", # isort
"ICN", # flake8-import-conventions
"INT", # flake8-gettext
"ISC", # flake8-implicit-str-concat
"LOG", # flake8-logging
"PGH", # pygrep-hooks
Expand All @@ -232,10 +230,10 @@ select = [
"RUF", # Ruff-specific rules
"SLOT", # flake8-slot
"T10", # flake8-debugger
"TID", # flake8-tidy-imports (Enables TID252)
"UP", # pyupgrade
"W", # pycodestyle warnings
"YTT", # flake8-2020
"TID", # flake8-tidy-imports (Enables TID252)
]

ignore = [
Expand All @@ -256,5 +254,14 @@ ignore = [
"W191", # tab-indentation
]

[tool.ruff.lint.flake8-gettext]
function-names = [
"tr",
"tr_noop",
]

[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.lint.mccabe]
max-complexity = 40