o
    ØÝ2g[  ã                   @   sf   d Z ddlZddlmZmZ ddlmZ erddlmZ G dd„ deƒZ	G dd	„ d	e	ƒZ
d
e
ƒ iZdS )z>Defines the different custom formats in which mypy can output.é    N)ÚABCÚabstractmethod)ÚTYPE_CHECKING)Ú	MypyErrorc                   @   s&   e Zd ZdZedddefdd„ƒZdS )ÚErrorFormatterzCBase class to define how errors are formatted before being printed.Úerrorr   Úreturnc                 C   s   t ‚)N)ÚNotImplementedError©Úselfr   © r   úL/home/garg/my-data/venv/lib/python3.10/site-packages/mypy/error_formatter.pyÚreport_error   s   zErrorFormatter.report_errorN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ústrr   r   r   r   r   r      s    r   c                   @   s"   e Zd ZdZdddefdd„ZdS )ÚJSONFormatterz'Formatter for basic JSON output format.r   r   r   c              
   C   sP   t  |j|j|j|jt|jƒdkrdnd |j¡|j	du rdn|j	j
|jdœ¡S )z3Prints out the errors as simple, static JSON lines.r   NÚ
)ÚfileÚlineÚcolumnÚmessageÚhintÚcodeÚseverity)ÚjsonÚdumpsÚ	file_pathr   r   r   ÚlenÚhintsÚjoinÚ	errorcoder   r   r
   r   r   r   r      s   ùÿzJSONFormatter.report_errorN)r   r   r   r   r   r   r   r   r   r   r      s    r   r   )r   r   Úabcr   r   Útypingr   Úmypy.errorsr   r   r   ÚOUTPUT_CHOICESr   r   r   r   Ú<module>   s    