관리-도구
편집 파일: docstring_checker.cpython-311.pyc
� �܋f� � �� � d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddl m Z ddlmZ ddl mZmZmZ ej d k rdd lmZ ndd lmZ ej d� � Zdd�Z G d� de� � ZdS )z)Docstring checker from the basic checker.� )�annotationsN)�nodes)� interfaces)�utils)� _BasicChecker)�is_overload_stub�is_property_deleter�is_property_setter)� � )�Literalz^_�node�1nodes.Module | nodes.ClassDef | nodes.FunctionDef�return� str | Nonec �� � | d }n# t $ r Y d S w xY wt j |� � }|sd S t |t j � � sd S t |j � � S )N�__doc__)�KeyErrorr � safe_infer� isinstancer �Const�str�value)r � docstrings �w/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/pylint/checkers/base/docstring_checker.py�_infer_dunder_doc_attributer ! s| � ����O� � ��� � � ��t�t����� � ��+�+�I�� ��t��i���-�-� ��t��y����s � � �c �> � e Zd Zdddddgifddddd gifd dddd gifd dddd gifd�Zdedddd�fdddddd�ffZd/d�Z ej dd� � d0d �� � Z ej dd� � d1d"�� � Z ej dd� � d2d$�� � ZeZd%e j fd3d-�Zd.S )4�DocStringCheckerzEmpty %s docstring�empty-docstringz^Used when a module, function, class or method has an empty docstring (it would be too easy ;).� old_names)�W0132zold-empty-docstringzMissing module docstring�missing-module-docstringzNUsed when a module has no docstring. Empty modules do not require a docstring.)�C0111zmissing-docstringzMissing class docstring�missing-class-docstringzNUsed when a class has no docstring. Even an empty class must have a docstring.z$Missing function or method docstring�missing-function-docstringzoUsed when a function or method has no docstring. Some special methods like __init__ do not require a docstring.)�C0112�C0114�C0115�C0116zno-docstring-rgx�regexpz<regexp>zcRegular expression which should only match function or class names that do not require a docstring.)�default�type�metavar�helpzdocstring-min-length����intz<int>z[Minimum line length for functions/classes that require docstrings, shorter ones are exempt.r �Nonec �B � | j j � � � d S )N)�linter�stats�reset_undocumented)�selfs r �openzDocStringChecker.openl s � ����,�,�.�.�.�.�.� r �nodes.Modulec �2 � | � d|� � d S )N�module)�_check_docstring�r6 r s r �visit_modulezDocStringChecker.visit_moduleo s � ����h��-�-�-�-�-r8 �nodes.ClassDefc � � | j j j � |j � � �| � d|� � d S d S )N�class)r3 �config�no_docstring_rgx�match�namer<