SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib64 > python3.11 > site-packages > pylint > checkers


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/checkers

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
base Directory - -
classes Directory - -
refactoring Directory - -
__init__.py File 4367 bytes April 17 2025 13:10:59.
async.py File 3923 bytes April 17 2025 13:10:59.
bad_chained_comparison.py File 2228 bytes April 17 2025 13:10:59.
base_checker.py File 10931 bytes April 17 2025 13:10:59.
deprecated.py File 9661 bytes April 17 2025 13:10:59.
design_analysis.py File 22139 bytes April 17 2025 13:10:59.
dunder_methods.py File 3513 bytes April 17 2025 13:10:59.
ellipsis_checker.py File 2014 bytes April 17 2025 13:10:59.
exceptions.py File 26673 bytes April 17 2025 13:10:59.
format.py File 27558 bytes April 17 2025 13:10:59.
imports.py File 42302 bytes April 17 2025 13:10:59.
lambda_expressions.py File 3462 bytes April 17 2025 13:10:59.
logging.py File 16221 bytes April 17 2025 13:10:59.
mapreduce_checker.py File 1111 bytes April 17 2025 13:10:59.
method_args.py File 4790 bytes April 17 2025 13:10:59.
misc.py File 4987 bytes April 17 2025 13:10:59.
modified_iterating_checker.py File 7859 bytes April 17 2025 13:10:59.
nested_min_max.py File 3720 bytes April 17 2025 13:10:59.
newstyle.py File 4567 bytes April 17 2025 13:10:59.
non_ascii_names.py File 7146 bytes April 17 2025 13:10:59.
raw_metrics.py File 3900 bytes April 17 2025 13:10:59.
similar.py File 34091 bytes April 17 2025 13:10:59.
spelling.py File 16556 bytes April 17 2025 13:10:59.
stdlib.py File 32028 bytes April 17 2025 13:10:59.
strings.py File 41242 bytes April 17 2025 13:10:59.
threading_checker.py File 1941 bytes April 17 2025 13:10:59.
typecheck.py File 88917 bytes April 17 2025 13:10:59.
unicode.py File 18480 bytes April 17 2025 13:10:59.
unsupported_version.py File 2999 bytes April 17 2025 13:10:59.
utils.py File 79111 bytes April 17 2025 13:10:59.
variables.py File 129607 bytes April 17 2025 13:10:59.

Reading File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/pylint/checkers/__init__.py

# 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

"""Utilities methods and classes for checkers.

Base id of standard checkers (used in msg and report ids):
01: base
02: classes
03: format
04: import
05: misc
06: variables
07: exceptions
08: similar
09: design_analysis
10: newstyle
11: typecheck
12: logging
13: string_format
14: string_constant
15: stdlib
16: python3 (This one was deleted but needs to be reserved for consistency with old messages)
17: refactoring
.
.
.
24: non-ascii-names
25: unicode
26: unsupported_version
27: private-import
28-50: not yet used: reserved for future internal checkers.
This file is not updated. Use
   script/get_unused_message_id_category.py
to get the next free checker id.

51-99: perhaps used: reserved for external checkers

The raw_metrics checker has no number associated since it doesn't emit any
messages nor reports. XXX not true, emit a 07 report !
"""

from __future__ import annotations

import sys
from typing import TYPE_CHECKING

from pylint.checkers.base_checker import (
    BaseChecker,
    BaseRawFileChecker,
    BaseTokenChecker,
)
from pylint.checkers.deprecated import DeprecatedMixin
from pylint.checkers.mapreduce_checker import MapReduceMixin
from pylint.utils import LinterStats, diff_string, register_plugins

if sys.version_info >= (3, 8):
    from typing import Literal
else:
    from typing_extensions import Literal

if TYPE_CHECKING:
    from pylint.lint import PyLinter


def table_lines_from_stats(
    stats: LinterStats,
    old_stats: LinterStats | None,
    stat_type: Literal["duplicated_lines", "message_types"],
) -> list[str]:
    """Get values listed in <columns> from <stats> and <old_stats>,
    and return a formatted list of values.

    The return value is designed to be given to a ureport.Table object
    """
    lines: list[str] = []
    if stat_type == "duplicated_lines":
        new: list[tuple[str, int | float]] = [
            ("nb_duplicated_lines", stats.duplicated_lines["nb_duplicated_lines"]),
            (
                "percent_duplicated_lines",
                stats.duplicated_lines["percent_duplicated_lines"],
            ),
        ]
        if old_stats:
            old: list[tuple[str, str | int | float]] = [
                (
                    "nb_duplicated_lines",
                    old_stats.duplicated_lines["nb_duplicated_lines"],
                ),
                (
                    "percent_duplicated_lines",
                    old_stats.duplicated_lines["percent_duplicated_lines"],
                ),
            ]
        else:
            old = [("nb_duplicated_lines", "NC"), ("percent_duplicated_lines", "NC")]
    elif stat_type == "message_types":
        new = [
            ("convention", stats.convention),
            ("refactor", stats.refactor),
            ("warning", stats.warning),
            ("error", stats.error),
        ]
        if old_stats:
            old = [
                ("convention", old_stats.convention),
                ("refactor", old_stats.refactor),
                ("warning", old_stats.warning),
                ("error", old_stats.error),
            ]
        else:
            old = [
                ("convention", "NC"),
                ("refactor", "NC"),
                ("warning", "NC"),
                ("error", "NC"),
            ]

    for index, value in enumerate(new):
        new_value = value[1]
        old_value = old[index][1]
        diff_str = (
            diff_string(old_value, new_value)
            if isinstance(old_value, float)
            else old_value
        )
        new_str = f"{new_value:.3f}" if isinstance(new_value, float) else str(new_value)
        old_str = f"{old_value:.3f}" if isinstance(old_value, float) else str(old_value)
        lines.extend((value[0].replace("_", " "), new_str, old_str, diff_str))  # type: ignore[arg-type]
    return lines


def initialize(linter: PyLinter) -> None:
    """Initialize linter with checkers in this package."""
    register_plugins(linter, __path__[0])


__all__ = [
    "BaseChecker",
    "BaseTokenChecker",
    "BaseRawFileChecker",
    "initialize",
    "MapReduceMixin",
    "DeprecatedMixin",
    "register_plugins",
]

SILENT KILLER Tool