id dZddlmZddlmZddlmZddlmZdddd d d d d ddd ZdeDZ Gddej Z Gdde Z Gdde Z Gdde ZGddej ZdS)z$Default formatting class for Flake8.)Optional)Set)base) Violationzzzzzzzzzz) boldblackredgreenyellowbluemagentacyanwhiteresetci|]}|dS)).0ks N/opt/cloudlinux/venv/lib/python3.11/site-packages/flake8/formatting/default.py rs $ $ $a $ $ $c:eZdZUdZeed<dddeefdZdS)SimpleFormatteraySimple abstraction for Default and Pylint formatter commonality. Sub-classes of this need to define an ``error_format`` attribute in order to succeed. The ``format`` method relies on that attribute and expects the ``error_format`` string to use the old-style formatting strings with named parameters: * code * text * path * row * col error_formaterrorrreturnc~|j|j|j|j|j|jd|jrtntzS)zFormat and write error out. If an output filename is specified, write formatted errors to that file. Otherwise, print the formatted error to standard out. )codetextpathrowcol) rrr filename line_number column_numbercolorCOLORS COLORS_OFFselfrs rformatzSimpleFormatter.format)sN  JJN$& $ $ 3vv $   rN)__name__ __module__ __qualname____doc__str__annotations__rr,rrrrrsT    K  HSM       rrceZdZdZdZddZdS)DefaultzDefault formatter for Flake8. This also handles backwards compatibility for people specifying a custom format string. z%(bold)s%(path)s%(reset)s%(cyan)s:%(reset)s%(row)d%(cyan)s:%(reset)s%(col)d%(cyan)s:%(reset)s %(bold)s%(red)s%(code)s%(reset)s %(text)srNcp|jjdkr|jj|_dSdS)z!Check for a custom format string.defaultN)optionsr,lowerrr+s r after_initzDefault.after_initFs9 <  $ $ & &) 3 3 $ 3D    4 3rrN)r-r.r/r0rr:rrrr4r49s< 4 444444rr4ceZdZdZdZdS)PylintzPylint formatter for Flake8.z%%(path)s:%(row)d: [%(code)s] %(text)sN)r-r.r/r0rrrrr=r=Ls&&:LLLrr=c`eZdZdZdZd dZdddeefdZdddeeffd Z xZ S) FilenameOnlyz&Only print filenames, e.g., flake8 -q.z%(path)srNc,t|_dS)z Initialize our set of filenames.N)setfilenames_already_printedr9s rr:zFilenameOnly.after_initWs3655&&&rrrcdS)zDo not include the source code.Nrr*s r show_sourcezFilenameOnly.show_source[rc|j|jvr@|j|jt|SdS)z%Ensure we only print each error once.N)r$rBaddsuperr,)r+r __class__s rr,zFilenameOnly.format^sG >!? ? ?  * . .u~ > > >77>>%(( (4rr;) r-r.r/r0rr:rr1rDr, __classcell__)rIs@rr?r?Rs00L9999..#....KHSMrr?cJeZdZdZdddeefdZdddeefdZdS)NothingzPrint absolutely nothing.rrrcdS)z Do nothing.Nrr*s rr,zNothing.formatjrErcdS)zDo not print the source.Nrr*s rrDzNothing.show_sourcemrErN)r-r.r/r0rr1r,rDrrrrLrLgsf##KHSM''#''''''rrLN)r0typingrrflake8.formattingrflake8.violationrr(r) BaseFormatterrr4r=r?rLrrrrSsw**""""""&&&&&&          % $V $ $ $      d(   D44444o444&;;;;;_;;; ?*'''''d '''''r