Skip to content
Merged
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
11 changes: 6 additions & 5 deletions check.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
}

# poChecker class - does all the main work
class poChecker:
class PoChecker:
totalIssues = 0

def __init__(
Expand Down Expand Up @@ -61,7 +61,7 @@ def process(self):
if self.check_source:
self.doCheck(entry.msgid)
if self.check_translation and entry.msgstr:
self.doCheck(entry.msgid)
self.doCheck(entry.msgstr)

self.tool.close()

Expand Down Expand Up @@ -90,7 +90,7 @@ def suggestCorrectionsFromCustomDic(self, typo, distance_limit=3):

return suggested_word

# Checks an issue against the
# Checks an issue against the custom dictionary to decide if it should be ignored
def isIssueValid(self, issue):
context = issue.context[
issue.offsetInContext : issue.offsetInContext + issue.errorLength
Expand All @@ -107,7 +107,7 @@ def outputIssue(self, issue):
pointer = "^" * issue.errorLength
context = issue.context.strip()
suggestion = None
self.totalIssues+=1
self.totalIssues += 1

print(Fore.RED + f"{issue.message.strip()}")
print(Fore.YELLOW + f"{context}")
Expand Down Expand Up @@ -184,12 +184,13 @@ def main():
default_config = jsonschema_default.create_from(schema)
config = {**default_config, **config}

checker = poChecker(
checker = PoChecker(
args.path,
language=args.language,
check_source=config["checkSourceString"],
check_translation=config["checkTranslationString"],
dict=config["customDictionary"],
disabled_rules=config["disabledRules"],
verbose=args.verbose,
)

Expand Down
Loading