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

Sun, 21 May 2023 15:26:11 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 21 May 2023 15:26:11 +0200
branch
eric7
changeset 10046
35b27af462ef
child 10052
041d0785dd42
permissions
-rw-r--r--

Code Style Checker
- Reorganized the code of the Imports Checker and extracted the name order stuff into its own checker.

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

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

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

from PyQt6.QtCore import QCoreApplication

_nameOrderMessages = {
    "NO101": QCoreApplication.translate(
        "ImportsChecker",
        "Import statements are in the wrong order. '{0}' should be before '{1}'",
    ),
    "NO102": QCoreApplication.translate(
        "ImportsChecker", "Imported names are in the wrong order. Should be '{0}'"
    ),
    "NO103": QCoreApplication.translate(
        "ImportsChecker",
        "Import statements should be combined. '{0}' should be combined with '{1}'",
    ),
    "NO104": QCoreApplication.translate(
        "ImportsChecker",
        "The names in __all__ are in the wrong order. The order should be '{0}'",
    ),
    "NO105": QCoreApplication.translate(
        "ImportsChecker",
        "The names in the exception handler list are in the wrong order. The order"
        " should be '{0}'",
    ),
}

_nameOrderMessagesSampleArgs = {
    "NO101": ["import bar", "import foo"],
    "NO102": ["bar, baz, foo"],
    "NO103": ["from foo import bar", "from foo import baz"],
    "NO104": ["bar, baz, foo"],
    "NO105": ["BarError, BazError, FooError"],
}

eric ide

mercurial