# Licensed under the GPL: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
# For details: https://github.com/PyCQA/pylint/blob/main/LICENSE
# Copyright (c) https://github.com/PyCQA/pylint/blob/main/CONTRIBUTORS.txt
from __future__ import annotations
from typing import TYPE_CHECKING
from astroid import nodes
from pylint.checkers import BaseChecker
from pylint.constants import DUNDER_METHODS, DUNDER_PROPERTIES, EXTRA_DUNDER_METHODS
from pylint.interfaces import HIGH
if TYPE_CHECKING:
from pylint.lint import PyLinter
class DunderChecker(BaseChecker):
"""Checks related to dunder methods."""
name = "dunder"
priority = -1
msgs = {
"W3201": (
"Bad or misspelled dunder method name %s.",
"bad-dunder-name",
"Used when a dunder method is misspelled or defined with a name "
"not within the predefined list of dunder names.",
),
}
options = (
(
"good-dunder-names",
{
"default": [],
"type": "csv",
"metavar": "