
    3j3'                        d dl m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Zd Zedk(  r e        yy# e$ r dZ
Y w xY w)
    )annotationsN)common)
commonTest)Runc                   t        j                         }t        t        d       yt	        j
                         }dg}g d}g d}|s||z   }dddddddd	}|sd
nd}|sdnd}	ddddddt        |      z   dddt        |	      z   dt        |      z   ddg}
|j                         D ]"  \  }}|
j                  d|z   dz   |z   dz          $ |D ]  }|
j                  d|         g }|j                  D ]=  }d}|D ]
  }||v sd} n |r| rd}| D ]
  }||v sd} n |r-|j                  |       ? |
|z   }|st        d        y	 t        |d!       y# t        $ r t        |d"       Y yw xY w)#zR
    `fnAccept` is a list of one or more files to test.  Otherwise, runs all.
    Nz<make sure that 'sudo pip3 install pylint' is there. exiting.z/ext/)ztoo-many-statementsztoo-many-argumentsztoo-many-public-methodsztoo-many-branchesztoo-many-linesztoo-many-return-statementsztoo-many-instance-attributesztoo-many-positional-argumentszinconsistent-return-statementszprotected-accesszkeyword-arg-before-vararg) zarguments-differzarguments-renamedzmultiple-importszredefined-variable-typezno-else-returnzcyclic-importzunnecessary-passzlocally-disabledzconsider-using-getzchained-comparisonztoo-many-ancestorsfixmezsuperfluous-parensztoo-many-localszbad-whitespacezbad-continuationztoo-many-boolean-expressionszunsubscriptable-objectzconsider-iterating-dictionaryzconsider-using-dict-itemszinvalid-nameztoo-few-public-methodsztrailing-whitespaceztrailing-newlineszmissing-docstringz	star-argszunused-argumentzimport-selfzsimplifiable-if-statementzconsider-using-enumerateznot-callablezraise-missing-fromz[a-z_][A-Za-z0-9_]{2,30}$z[A-Z_][A-Za-z0-9_]{2,30}$z,(([a-z_][a-zA-Z0-9_]*)|([A-Z][a-zA-Z0-9]+))$)zargument-rgxzattr-rgxz	class-rgxzfunction-rgxz
method-rgxz
module-rgxzvariable-rgx         
   z--output-format=parseablez:--dummy-variables-rgx="_$|dummy|unused|i$|j$|junk|counter"z--docstring-min-length=3z--ignore-docstrings=yesz--min-similarity-lines=8z--max-args=z!--bad-names="foo,shit,fuck,stuff"z--reports=nz--max-branches=z-j z&--ignore-long-lines="converter\.parse"z--max-line-length=100z--z=""z
--disable=FTzNo matching files were found.)exit)do_exit)r   cpus	pylintRunprintr   ModuleGatherstritemsappendmodulePaths	TypeError)fnAcceptstrictpoolSizemgfnPathRejectdisable_unless_strictdisable
goodNameRxmaxArgsmaxBranchescmdgngnvpyLintId
acceptablefprejectIt
rejectPathacceptableNamecmdFiles                       B/DATA/.local/lib/python3.12/site-packages/music21/test/testLint.pymainr.   2   s    {{}HLM		 	 	"B
 	L"=G| 11">:;"> < O">J a1G""K&H%$%3w<'.s;//3x= 4"C ##%C

4"9t#c)C/0 & 

Zz*+  Jnn&JR ' H"*!R'$H #+ "# & JG-.*'& *'5)*s   E E.-E.c                    t        j                  d      } | j                  ddt        dd       | j                  dd	d
       | j	                         }|j
                  r|j
                  nd }|rw|D cg c]!  }t        j                  j                  |      # }}g }|D ]D  }t        j                  j                  |      r|j                  |       4t        d|z   dz          F t        ||j                         y c c}w )Nz/Run pylint on music21 according to style guide.)descriptionfilesfilename*z#Files to parse (default nearly all))metavartypenargshelpz--strict
store_truezRun the file in strict mode)actionr7   z	skipping z: no matching file)argparseArgumentParseradd_argumentr   
parse_argsr1   ospathabspathexistsr   r   r.   r   )parserargsr1   ffilesMids        r-   argRunrF      s    $$EGF
#SB  D

<:  <D **DJJ$E0561BGGOOA&6Aww~~a QkAo(<<=	 
 	 7s   5&C?__main__)NF)
__future__r   r:   r>   music21r   music21.testr   pylint.lintr   r   ImportErrorr.   rF   __name__     r-   <module>rP      sW    #
  	  #,4i*X, z
H w  Is   7 A A