src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/NameOrder/translations.py

Thu, 27 Feb 2025 14:42:39 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 27 Feb 2025 14:42:39 +0100
branch
eric7
changeset 11150
73d80859079c
parent 11090
f5f5f5803935
permissions
-rw-r--r--

Code Style Checkers
- Refactored the various code style checkers for better maintainability.

# -*- coding: utf-8 -*-

# Copyright (c) 2021 - 2025 Detlev Offenbach <detlev@die-offenbachs.de>
#

"""
Module implementing message translations for the code style plugin
(name ordering part).
"""

from PyQt6.QtCore import QCoreApplication

_nameOrderMessages = {
    "NO-101": QCoreApplication.translate(
        "NameOrderChecker",
        "Import statements are in the wrong order. '{0}' should be before '{1}'",
    ),
    "NO-102": QCoreApplication.translate(
        "NameOrderChecker", "Imported names are in the wrong order. Should be '{0}'"
    ),
    "NO-103": QCoreApplication.translate(
        "NameOrderChecker",
        "Import statements should be combined. '{0}' should be combined with '{1}'",
    ),
    "NO-104": QCoreApplication.translate(
        "NameOrderChecker",
        "The names in __all__ are in the wrong order. The order should be '{0}'",
    ),
    "NO-105": QCoreApplication.translate(
        "NameOrderChecker",
        "The names in the exception handler list are in the wrong order. The order"
        " should be '{0}'",
    ),
}

_nameOrderMessagesSampleArgs = {
    "NO-101": ["import bar", "import foo"],
    "NO-102": ["bar, baz, foo"],
    "NO-103": ["from foo import bar", "from foo import baz"],
    "NO-104": ["bar, baz, foo"],
    "NO-105": ["BarError, BazError, FooError"],
}

eric ide

mercurial