Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and renovate[bot] committed Oct 18, 2024
1 parent 854da6e commit c8ecca0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion weblate/checks/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# SPDX-License-Identifier: GPL-3.0-or-later

# We ignore some words which are usually untranslated
import string

IGNORE_WORDS = {
"abc",
"accelerator",
Expand Down Expand Up @@ -987,7 +989,7 @@
"powerpc",
"sparc",
# whole alphabet
"abcdefghijklmnopqrstuvwxyz",
string.ascii_lowercase,
}

"""
Expand Down
4 changes: 3 additions & 1 deletion weblate/utils/inv_regex.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#
# Based on https://github.com/pyparsing/pyparsing/blob/master/examples/inv_regex.py

import string

from pyparsing import (
Combine,
Empty,
Expand Down Expand Up @@ -154,7 +156,7 @@ def handle_literal(toks):
def handle_macro(toks):
macro_char = toks[0][1]
if macro_char == "d":
return CharacterRangeEmitter("0123456789")
return CharacterRangeEmitter(string.digits)
if macro_char == "w":
return CharacterRangeEmitter(srange("[A-Za-z0-9_]"))
if macro_char in {"s", "W"}:
Expand Down

0 comments on commit c8ecca0

Please sign in to comment.