Skip to content

Fix class naming, translation check bug, missing disabled_rules param, and PEP 8 style#3

Merged
admdly merged 2 commits intomainfrom
copilot/rename-class-and-fix-translation-check
Mar 17, 2026
Merged

Fix class naming, translation check bug, missing disabled_rules param, and PEP 8 style#3
admdly merged 2 commits intomainfrom
copilot/rename-class-and-fix-translation-check

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

Several bugs and style issues in check.py including a logic bug causing translation strings to never actually be checked.

Changes

  • Bug fix: process() was calling doCheck(entry.msgid) for both source and translation checks — translations were never actually checked. Fixed to doCheck(entry.msgstr).
  • Missing param: disabled_rules was defined in PoChecker.__init__ and wired into LanguageTool config, but never passed from main(). Added disabled_rules=config["disabledRules"] to the constructor call.
  • Rename: poCheckerPoChecker to follow Python PascalCase convention.
  • Comment: Completed truncated docstring on isIssueValid# Checks an issue against the# Checks an issue against the custom dictionary to decide if it should be ignored.
  • Style: self.totalIssues+=1self.totalIssues += 1 (PEP 8).
Original prompt
Please apply the following diffs and create a pull request.
Once the PR is ready, give it a title based on the messages of the fixes being applied.

[{"message":"Class name 'poChecker' does not follow Python's PascalCase naming convention for classes. It should be renamed to 'PoChecker'.","fixFiles":[{"filePath":"check.py","diff":"diff --git a/check.py b/check.py\n--- a/check.py\n+++ b/check.py\n@@ -26,7 +26,7 @@\n }\n \n # poChecker class - does all the main work\n-class poChecker:\n+class PoChecker:\n     totalIssues = 0\n \n     def __init__(\n"}]},{"message":"When checking translations, the code incorrectly checks 'entry.msgid' (source string) instead of 'entry.msgstr' (translation string). This should be 'self.doCheck(entry.msgstr)' to properly check the translation.","fixFiles":[{"filePath":"check.py","diff":"diff --git a/check.py b/check.py\n--- a/check.py\n+++ b/check.py\n@@ -61,7 +61,7 @@\n             if self.check_source:\n                 self.doCheck(entry.msgid)\n             if self.check_translation and entry.msgstr:\n-                self.doCheck(entry.msgid)\n+                self.doCheck(entry.msgstr)\n \n         self.tool.close()\n         \n"}]},{"message":"Incomplete comment. The comment should be completed to explain what the issue is being checked against (e.g., 'Checks an issue against the custom dictionary').","fixFiles":[{"filePath":"check.py","diff":"diff --git a/check.py b/check.py\n--- a/check.py\n+++ b/check.py\n@@ -90,7 +90,7 @@\n \n         return suggested_word\n \n-    # Checks an issue against the \n+    # Checks an issue against the custom dictionary to decide if it should be ignored\n     def isIssueValid(self, issue):\n         context = issue.context[\n             issue.offsetInContext : issue.offsetInContext + issue.errorLength\n"}]},{"message":"Missing spaces around the '+=' operator. Should be 'self.totalIssues += 1' for consistency with PEP 8 style guidelines.","fixFiles":[{"filePath":"check.py","diff":"diff --git a/check.py b/check.py\n--- a/check.py\n+++ b/check.py\n@@ -107,7 +107,7 @@\n         pointer = \"^\" * issue.errorLength\n         context = issue.context.strip()\n         suggestion = None\n-        self.totalIssues+=1\n+        self.totalIssues += 1\n \n         print(Fore.RED + f\"{issue.message.strip()}\")\n         print(Fore.YELLOW + f\"{context}\")\n"}]},{"message":"The 'disabled_rules' parameter is not being passed to the poChecker constructor, even though it's defined in the constructor and used in the LanguageTool configuration. This should be added as 'disabled_rules=config[\\\"disabledRules\\\"]'.","fixFiles":[{"filePath":"check.py","diff":"diff --git a/check.py b/check.py\n--- a/check.py\n+++ b/check.py\n@@ -190,6 +190,7 @@\n         check_source=config[\"checkSourceString\"],\n         check_translation=config[\"checkTranslationString\"],\n         dict=config[\"customDictionary\"],\n+        disabled_rules=config[\"disabledRules\"],\n         verbose=args.verbose,\n     )\n \n"}]}]

💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

…ed_rules param

Co-authored-by: admdly <2807620+admdly@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix class naming convention and translation checks Fix class naming, translation check bug, missing disabled_rules param, and PEP 8 style Mar 17, 2026
Copilot AI requested a review from admdly March 17, 2026 12:12
@admdly admdly marked this pull request as ready for review March 17, 2026 12:13
@admdly admdly merged commit 88328b1 into main Mar 17, 2026
4 checks passed
@admdly admdly deleted the copilot/rename-class-and-fix-translation-check branch March 17, 2026 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants