o
    h                     @  s   d Z ddlmZ ddlZddlZddlZddlmZ ddlmZ ddl	m
Z
 ddl	mZ eeZejdd	dddZG dd deZdS )z3Contains the Violation error class used internally.    )annotationsN)Match)
NamedTuple)defaults)utilsi   )maxsizephysical_linestrreturnMatch[str] | Nonec                 C  s   t j| S )N)r   NOQA_INLINE_REGEXPsearch)r    r   F/var/www/html/ai/venv/lib/python3.10/site-packages/flake8/violation.py
_find_noqa   s   r   c                   @  sL   e Zd ZU dZded< ded< ded< ded< ded< d	ed
< dddZdS )	Violationz2Class representing a violation reported by Flake8.r	   codefilenameintline_numbercolumn_numbertextz
str | Noner   disable_noqaboolr
   c                 C  s   | j }|rdS |du rt| j| j}t|}|du r#td|  dS | d }|du r5td|  dS t	t
|}| j|v sI| jt|rRtd| | dS td| | dS )	zDetermine if a comment has been added to ignore this line.

        :param disable_noqa:
            Whether or not users have provided ``--disable-noqa``.
        :returns:
            True if error is ignored in-line, False otherwise.
        FNz%r is not inline ignoredcodesz%%r is ignored by a blanket ``# noqa``Tz5%r is ignored specifically inline with ``# noqa: %s``z,%r is not ignored inline with ``# noqa: %s``)r   	linecachegetliner   r   r   LOGdebug	groupdictsetr   parse_comma_separated_listr   
startswithtuple)selfr   r   
noqa_match	codes_strr   r   r   r   is_inline_ignored    s2   zViolation.is_inline_ignoredN)r   r   r
   r   )__name__
__module____qualname____doc____annotations__r'   r   r   r   r   r      s   
 r   )r   r	   r
   r   )r+   
__future__r   	functoolsr   loggingtypingr   r   flake8r   r   	getLoggerr(   r   	lru_cacher   r   r   r   r   r   <module>   s    

