
    \Og                        S r SSKJr  SSKrSSKrSSKrSSKJr  SSK	J
r
  SSKJr  SSKJr  SSKJr  \R&                  " \5      rS	r " S
 S5      r " S S5      rSS jrg)zModule containing shims around Flake8 2.x behaviour.

Previously, users would import :func:`get_style_guide` from ``flake8.engine``.
In 3.0 we no longer have an "engine" module but we maintain the API from it.
    )annotationsN)Any)expand_paths)base)application)
parse_args)get_style_guidec                  @    \ rS rSrSrSS jr\S	S j5       rS
S jrSr	g)Report   a  Public facing object that mimic's Flake8 2.0's API.

.. note::

    There are important changes in how this object behaves compared to
    the object provided in Flake8 2.x.

.. warning::

    This should not be instantiated by users.

.. versionchanged:: 3.0.0
c                    UR                   c   eXl        UR                   U l        U R                  R                  U l        g)z\Initialize the Report for the user.

.. warning:: This should not be instantiated by users.
N)guide_application_style_guidestats_statsselfr   s     V/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/flake8/api/legacy.py__init__Report.__init__'   s=    
   ,,,''--''--    c                .    U R                   R                  $ )z"Return the total number of errors.)r   result_countr   s    r   total_errorsReport.total_errors1   s       ---r   c                    U R                   R                  U5       Vs/ s H+  nUR                   SUR                   SUR                   3PM-     sn$ s  snf )zGet the list of occurrences of a violation.

:returns:
    List of occurrences of a violation formatted as:
    {Count} {Error Code} {Message}, e.g.,
    ``8 E531 Some error message about the error``
 )r   statistics_forcount
error_codemessage)r   	violationss      r   get_statisticsReport.get_statistics6   sU     [[//	:
: wwiqa		{3:
 	
 
s   2A)r   r   r   Nr   zapp.ApplicationreturnNone)r)   int)r$   strr)   	list[str])
__name__
__module____qualname____firstlineno____doc__r   propertyr   r&   __static_attributes__ r   r   r   r      s%    . . .
r   r   c                      \ rS rSrSrSS jr\SS j5       r\SS j5       rSSS jjr	SSS jjr
 S   SS	 jjr   S         SS
 jjrSrg)
StyleGuideD   a(  Public facing object that mimic's Flake8 2.0's StyleGuide.

.. note::

    There are important changes in how this object behaves compared to
    the StyleGuide object provided in Flake8 2.x.

.. warning::

    This object should not be instantiated directly by users.

.. versionchanged:: 3.0.0
c                2    Xl         UR                  U l        g)zInitialize our StyleGuide.N)r   file_checker_manager_file_checker_managerr   s     r   r   StyleGuide.__init__S   s    '%0%E%E"r   c                `    U R                   R                  c   eU R                   R                  $ )zeReturn application's options.

An instance of :class:`argparse.Namespace` containing parsed options.
)r   optionsr   s    r   r>   StyleGuide.optionsX   s.       ((444  (((r   c                t    U R                   R                  c   eU R                   R                  R                  $ )z+Return the extra arguments passed as paths.)r   r>   	filenamesr   s    r   pathsStyleGuide.pathsa   s4       ((444  ((222r   Nc                    U R                   R                  c   eXR                   R                  l        U R                   R                  5         U R                   R	                  5         [        U R                   5      $ )zRun collected checks on the files provided.

This will check the files passed in and return a :class:`Report`
instance.

:param paths:
    List of filenames (or paths) to check.
:returns:
    Object that mimic's Flake8 2.0's Reporter class.
)r   r>   rA   
run_checksreport_errorsr   )r   rB   s     r   check_filesStyleGuide.check_filesg   sc       ((444.3!!+$$&'')d''((r   c                   ^  SU 4S jjnU" U5      =(       d0    USL=(       a%    U" [         R                  R                  X!5      5      $ )zDetermine if a file is excluded.

:param filename:
    Path to the file to check if it is excluded.
:param parent:
    Name of the parent directory containing the file.
:returns:
    True if the filename is excluded, False otherwise.
c           	        > [        [        U /TR                  R                  TR                  R                  TR                  R
                  S95      nU(       + $ )N)rB   stdin_display_namefilename_patternsexclude)tupler   r>   rK   filenamerM   )pathrB   r   s     r   excluded%StyleGuide.excluded.<locals>.excluded   sK    &'+||'F'F&*ll&;&; LL00	E 9r   N)rP   r,   r)   bool)osrP   join)r   rO   parentrQ   s   `   r   rQ   StyleGuide.excludedx   s;    		 ! 
$K8BGGLL,J#K	
r   c                P   Uc  g[        U[        R                  5      (       d  [        S5      eU" U R                  5      U R
                  l        SU R
                  l        U R
                  R                  5         SU R
                  l        U R
                  R                  / 5        g)z*Set up a formatter for this run of Flake8.Nz<Report should be subclass of flake8.formatter.BaseFormatter.)

issubclass	formatterBaseFormatter
ValueErrorr>   r   r   
make_guider:   make_file_checker_manager)r   reporters     r   init_reportStyleGuide.init_report   s    
 (I$;$;<<2  '/t||&<#"& 	$$&15.33B7r   c                &    U R                  U/5      $ )as  Run collected checks on a single file.

This will check the file passed in and return a :class:`Report`
instance.

:param filename:
    The path to the file to check.
:param lines:
    Ignored since Flake8 3.0.
:param expected:
    Ignored since Flake8 3.0.
:param line_offset:
    Ignored since Flake8 3.0.
:returns:
    Object that mimic's Flake8 2.0's Reporter class.
)rG   )r   rO   linesexpectedline_offsets        r   
input_fileStyleGuide.input_file   s    . 
++r   )r   r;   r(   )r)   zargparse.Namespace)r)   r-   )N)rB   zlist[str] | Noner)   r   )rO   r,   rV   z
str | Noner)   rS   )r_   z$type[formatter.BaseFormatter] | Noner)   r*   )NNr   )
rO   r,   rc   
Any | Nonerd   rh   re   rh   r)   r   )r.   r/   r0   r1   r2   r   r3   r>   rB   rG   rQ   r`   rf   r4   r5   r   r   r7   r7   D   s    F
 ) ) 3 3
)"
8 :>868 
80 !#"#,, , 	,
  , 
, ,r   r7   c                    [         R                  " 5       n[        / 5      u  Ul        Ul        UR                  nU R                  5        H  u  p4 [        X#5        [        X#U5        M     UR                  5         UR                  5         UR                  / 5        [        U5      $ ! [         a    [        R                  SU5         M  f = f)zProvision a StyleGuide for use.

:param \*\*kwargs:
    Keyword arguments that provide some options for the StyleGuide.
:returns:
    An initialized StyleGuide
zCould not update option "%s")appApplicationr   pluginsr>   itemsgetattrsetattrAttributeErrorLOGerrormake_formatterr]   r^   r7   )kwargsr   r>   keyvalues        r   r	   r	      s     //#K/9"~,K, !!Glln
	;G!G%( %  ))"-k""  	;II4c:	;s   B'' C
C)rt   r   r)   r7   )r2   
__future__r   argparseloggingos.pathrT   typingr   flake8.discover_filesr   flake8.formattingr   rZ   flake8.mainr   rj   flake8.options.parse_argsr   	getLoggerr.   rq   __all__r   r7   r	   r5   r   r   <module>r      s[   
 #     . / * 0! )
 )
Xz, z,z#r   