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

Thu, 30 Nov 2023 17:48:55 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 30 Nov 2023 17:48:55 +0100
branch
eric7
changeset 10363
6244c89dbc3f
parent 10362
cfa7034cccf6
child 10367
b189ca1f5d53
permissions
-rw-r--r--

Fixed some code style and formatting issues as well as an implementation issue.

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

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


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

from PyQt6.QtCore import QCoreApplication

_loggingMessages = {
    ## Logging format
    "L101": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses string.format()",
    ),
    "L102": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses '%'",  # __IGNORE_WARNING_M601__
    ),
    "L103": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses '+'",
    ),
    "L104": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses f-string",
    ),
    "L110": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses 'warn' instead of 'warning'",
    ),
    "L121": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses an extra field that clashes with a LogRecord field:"
        " {0}",
    ),
    "L130": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement uses exception in arguments",
    ),
    "L131": QCoreApplication.translate(
        "LoggingChecker",
        "logging: .exception(...) should be used instead of .error(..., exc_info=True)",
    ),
    "L132": QCoreApplication.translate(
        "LoggingChecker",
        "logging statement has redundant exc_info",
    ),
}

_loggingMessagesSampleArgs = {
    "L121": ["pathname"],
}

eric ide

mercurial