src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Pydantic/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 11143
ef75c265ab47
permissions
-rw-r--r--

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

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

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

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

from PyQt6.QtCore import QCoreApplication

_pydanticMessages = {
    ## pydantic
    "PYD-001": QCoreApplication.translate(
        "PydanticChecker",
        "positional argument for Field default argument",
    ),
    "PYD-002": QCoreApplication.translate(
        "PydanticChecker",
        "non-annotated attribute inside Pydantic model",
    ),
    "PYD-003": QCoreApplication.translate(
        "PydanticChecker",
        "unecessary Field call to specify a default value",
    ),
    "PYD-004": QCoreApplication.translate(
        "PydanticChecker",
        "default argument specified in annotated",
    ),
    "PYD-005": QCoreApplication.translate(
        "PydanticChecker",
        "field name overrides annotation",
    ),
    "PYD-006": QCoreApplication.translate(
        "PydanticChecker",
        "duplicate field name",
    ),
    "PYD-010": QCoreApplication.translate(
        "PydanticChecker",
        "usage of __pydantic_config__; consider using the `with_config` decorator",
    ),
}

eric ide

mercurial