o
    bX                     @   sN   d dl Z d dlmZ d dlmZmZ d dlmZ G dd dejZ	dd Z
dS )	    N)checkers)IAstroidCheckerHIGH)check_messagesc                   @   sP   e Zd ZdZeZdZdddZedddd	 Z	d
d Z
dd ZeZdd ZdS )DocStringStyleCheckerz-Checks format of docstrings based on PEP 0257Zdocstyle)z2Bad docstring quotes in %s, expected """, given %sbad-docstring-quotesz9Used when a docstring does not have triple double quotes.)z First line empty in %s docstringdocstring-first-line-emptyz@Used when a blank line is found at the beginning of a docstring.)ZC0198ZC0199r   r   c                 C      |  d| d S )Nmodule_check_docstringselfnode r   Y/var/www/secure340b-portal/env/lib/python3.10/site-packages/pylint/extensions/docstyle.pyvisit_module#   s   z"DocStringStyleChecker.visit_modulec                 C   r	   )Nclassr   r   r   r   r   visit_classdef'   s   z$DocStringStyleChecker.visit_classdefc                 C   s    |  rdnd}| || d S )Nmethodfunction)Z	is_methodr   )r   r   Zftyper   r   r   visit_functiondef*   s   z'DocStringStyleChecker.visit_functiondefc                 C   s   |j }|r|d dkr| jd||ftd |rb|jd }t| j| }|r2|	ddkr2d S |r;d|v r;d}n|rF|d dkrFd}n|rQ|d d	krQd	}nd
}|rd| jd|||ftd d S d S d S )Nr   
r   )r   args
confidence   z"""z'''"'Fr   )
docZadd_messager   Z
fromlineno	linecachegetlinerootfilelstripfind)r   Z	node_typer   	docstringlinenolinequotesr   r   r   r   0   s:   


z&DocStringStyleChecker._check_docstringN)__name__
__module____qualname____doc__r   Z__implements__nameZmsgsr   r   r   r   Zvisit_asyncfunctiondefr   r   r   r   r   r      s    
r   c                 C   s   |  t|  dS )zRequired method to auto register this checker.

    :param linter: Main interface object for Pylint plugins
    :type linter: Pylint object
    N)Zregister_checkerr   )Zlinterr   r   r   registerS   s   r.   )r   Zpylintr   Zpylint.interfacesr   r   Zpylint.checkers.utilsr   ZBaseCheckerr   r.   r   r   r   r   <module>   s   C