bgddlmZddlZddlZddlmZddlmZddlm Z ddl m Z ej dkrddl mZnddlmZed d z ZGd d ZdS) ) annotationsN)Path)GitCommandError)Git)Repo))Literaltestsz.pylint_primer_testsceZdZUdZded< ded< ded< ded< ded < ded < ded < dddZeddZeddZeddZ eddZ ddZ ddZ ddZ d S) PackageToLintzARepresents data about a package to be tested during primer tests.strurlbranch list[str] directories str | Nonecommitpylint_additional_argspylintrc_relpathminimum_pythonNlist[str] | NonereturnNonecl||_||_||_||_|pg|_||_||_dS)N)rrrrrrr)selfrrrrrrrs y/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pylint/testutils/_primer/package_to_lint.py__init__zPackageToLint.__init__/sD & &<&B# 0,Path | Literal['']c2|jdS|j|jz S)N)rclone_directoryrs rpylintrczPackageToLint.pylintrcAs!  (2#d&;;;rrcd|jddddd}t|z S)z#Directory to clone repository into./Nz.gitr")joinrsplitreplacePRIMER_DIRECTORY_PATH)r clone_names rr#zPackageToLint.clone_directoryHsGXXdhnnS11"##677??KK $z11rc*fdjDS)zThe paths we need to lint.c>g|]}tj|z S)rr#).0pathrs r z/PackageToLint.paths_to_lint..Qs)NNNTD(4/00NNNr)rr$s`r paths_to_lintzPackageToLint.paths_to_lintNs#ONNNT=MNNNNrcFg}|d|jgz }|j|z|jzS)Nz --rcfile=)r%r4r)roptionss r pylint_argszPackageToLint.pylint_argsSs5/ //00!G+d.IIIrctjd|j|js|S|S)aConcatenates the target directory and clones the file. Not expected to be tested as the primer won't work if it doesn't. It's tested in the continuous integration primers, only the coverage is not calculated on everything. If lazy clone breaks for local use we'll probably notice because we'll have a fatal when launching the primer locally. zLazy cloning %s)logginginforr#exists_clone_repository_pull_repositoryr$s r lazy_clonezPackageToLint.lazy_cloneZsT  &111#**,, ,))++ +$$&&&rc|jt|j|jdd}t jd|t j|j|j|jd}t|jj j S)N)rto_pathrdepthz&Directory does not exists, cloning: %s) rrr#rr9r:r clone_fromheadobjecthexsha)rr6repos rr<zPackageToLint._clone_repositoryhs}84/00k ) )   =wGGG$"6t{RS   49#*+++rct|j|jdd}t |jjjj }||krvtj d|| t |j}|j j }|n>#t$r}t!d|j|d}~wwxYwtj dt#|S)N rz?Remote sha is '%s' while local sha is '%s': pulling new commitszFailed to clone repository for zRepository already up to date.)r ls_remoterrr*rr#rDrErFr9r:remotesoriginpullr SystemErrorr)rremote_sha1_commitlocal_sha1_commitrGrLes rr=zPackageToLint._pull_repositoryus UU__TXt{CCII$OOPQR !566;BI !2 2 2 LQ"!     D011, "   !Ld6JLL  L9 : : :%&&&s4B;; C"CC")NNNN)rrrrrrrrrrrrrrrr)rr )rr)rr)rr)__name__ __module__ __qualname____doc____annotations__rpropertyr%r#r4r7r>r<r=r0rrr r sjKK HHH)KKK,?/%%%%&    Q:"37'+%)-----$<<<X< 222X2 OOOXOJJJXJ ' ' ' ' , , , ,''''''rr ) __future__rr9syspathlibrgitrgit.cmdrgit.repor version_infotypingr typing_extensionsr,r r0rrras #""""" v))))))W (>>q'q'q'q'q'q'q'q'q'q'r