eric7/Plugins/CheckerPlugins/CodeStyleChecker/Imports/translations.py

Thu, 02 Dec 2021 18:53:26 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 02 Dec 2021 18:53:26 +0100
branch
eric7
changeset 8802
129a973fc33e
parent 8801
8fbb21be8579
child 8808
033fa34447d0
permissions
-rw-r--r--

Continued implementing a checker for import statements (import order).

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

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

"""
Module implementing message translations for the code style plugin messages
(import statements part).
"""

from PyQt6.QtCore import QCoreApplication

_importsMessages = {
    "I101": QCoreApplication.translate(
        "ImportsChecker",
        "local import must be at the beginning of the method body"),
    "I102": QCoreApplication.translate(
        "ImportsChecker",
        "packages from external modules should not be imported locally"),
    "I103": QCoreApplication.translate(
        "ImportsChecker",
        "packages from standard modules should not be imported locally"),
    
    "I201": QCoreApplication.translate(
        "ImportsChecker",
        "Import statements are in the wrong order. "
        "'{0}' should be before '{1}'"),
    "I202": QCoreApplication.translate(
        "ImportsChecker",
        "Imported names are in the wrong order. "
        "Should be {0}"),
    "I203": QCoreApplication.translate(
        "ImportsChecker",
        "Import statements should be combined. "
        "'{0}' should be combined with '{1}'"),
    "I204": QCoreApplication.translate(
        "ImportsChecker",
        "The names in __all__ are in the wrong order. "
        "The order should be {0}"),
}

_importsMessagesSampleArgs = {
    "I201": ["import os", "import sys"],
    "I202": ["copy, os, sys"],
    "I203": ["from foo import bar", "from foo import baz"],
    "I204": ["bar, baz, foo"],
}

eric ide

mercurial