
    Mi=>                    <   S SK Jr  S SK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  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  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!  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+  S SK,J-r-  S SK.J/r/  S SK0J1r1  \Rd                  " S5      r3\Rh                  Rk                  SS5        \Rh                  Rk                  SS5        1 Skr6S#S jr7S#S jr8S#S jr9S$S  jr:S%S&S! jjr;\<S":X  a  \=" \;" 5       5      eg)'    )annotationsN)Sequence)	clientlib)git)add_color_option)hazmat)
autoupdate)clean)gc)	hook_impl)init_templatedir)install)install_hooks)	uninstall)migrate_config)run)sample_config)try_repo)validate_config)validate_manifest)error_handler)logging_handler)Store
pre_commit__PYVENV_LAUNCHER__PYTHONEXECUTABLE>   r   r
   r   sample-configvalidate-configinit-templatedirvalidate-manifestc                D    U R                  SS[        R                  SS9  g )Nz-cz--configzPath to alternate config file)defaulthelp)add_argumentCCONFIG_FILEparsers    i/var/www/eduai.edurigo.com/storigo/production/storigo_env/lib/python3.13/site-packages/pre_commit/main.py_add_config_optionr*   2   s#    
j!--,      c                F    U R                  SS[        R                  SSS9  g )Nz-t--hook-typeappend
hook_types)choicesactiondest)r$   r   
HOOK_TYPESr'   s    r)   _add_hook_type_optionr4   9   s'    
m$$XL  r+   c                   U R                  SSSS9  U R                  SSSS9  U R                  S	S
9nUR                  SSSSS9  UR                  SS/ SS9  U R                  SSSS9  U R                  SSSS9  U R                  S[        R                  [        R                  SSS9  U R                  SSS9  U R                  SSS9  U R                  S S!S"S#S9  U R                  S$S%S&S'S9  U R                  S(S)S9  U R                  S*S+S9  U R                  S,S-S9  U R                  S.S/S9  U R                  S0S1S9  U R                  S2S3S9  U R                  S4S5S9  U R                  S6S7S9  U R                  S8S9S9  U R                  S:S;S9  g )<Nhook?zA single hook-id to runnargsr#   z	--verbosez-v
store_truer1   Frequiredz--all-filesz-az!Run on all the files in the repo.r1   r#   z--files*z#Specific filenames to run hooks on.)r9   r"   r#   z--show-diff-on-failurez3When hooks fail, run `git diff` directly afterward.z--fail-fastz"Stop after the first failing hook.z--hook-stage
pre-commitz=The stage during which the hook is fired.  One of %(choices)s)r0   typer"   r#   z--remote-branchz%Remote branch ref used by `git push`.r#   z--local-branchz$Local branch ref used by `git push`.z
--from-refz--sourcez-sa  (for usage with `--to-ref`) -- this option represents the original ref in a `from_ref...to_ref` diff expression.  For `pre-push` hooks, this represents the branch you are pushing to.  For `post-checkout` hooks, this represents the branch that was previously checked out.z--to-refz--originz-oa  (for usage with `--from-ref`) -- this option represents the destination ref in a `from_ref...to_ref` diff expression.  For `pre-push` hooks, this represents the branch being pushed.  For `post-checkout` hooks, this represents the branch that is now checked out.z--pre-rebase-upstreamz.The upstream from which the series was forked.z--pre-rebase-branchzKThe branch being rebased, and is not set when  rebasing the current branch.z--commit-msg-filenamez2Filename to check when running during `commit-msg`z--prepare-commit-message-sourcez]Source of the commit message (typically the second argument to .git/hooks/prepare-commit-msg)z--commit-object-namezRCommit object name (typically the third argument to .git/hooks/prepare-commit-msg)z--remote-namezRemote name used by `git push`.z--remote-urlzRemote url used by `git push`.z--checkout-typezIndicates whether the checkout was a branch checkout (changing branches, flag=1) or a file checkout (retrieving a file from the index, flag=0).z--is-squash-mergezHDuring a post-merge hook, indicates whether the merge was a squash mergez--rewrite-commandzJDuring a post-rewrite hook, specifies the command that invoked the rewrite)r$   add_mutually_exclusive_groupr   STAGEStransform_stage)r(   mutex_groups     r)   _add_run_optionsrG   @   ss   
c0IJ
T,?55u5EKtL0   b2    B   l1     &&L    G   E   j$&  
 J  	 <  
 +   A   )O   N   ?   -MN
,        r+   c                ^   [         R                  R                  U R                  5      (       a.  [         R                  R	                  U R                  5      U l        U R
                  S;   az  U R                   Vs/ s H"  n[         R                  R	                  U5      PM$     snU l        U R                  b.  [         R                  R	                  U R                  5      U l        U R
                  S:X  a\  [         R                  R                  U R                  5      (       a.  [         R                  R	                  U R                  5      U l        [        R                  " 5       n[         R                  " U5        [         R                  R                  U R                  5      U l        U R
                  S;   az  U R                   Vs/ s H"  n[         R                  R                  U5      PM$     snU l        U R                  b.  [         R                  R                  U R                  5      U l        U R
                  S:X  a^  [         R                  R                  U R                  5      (       a/  [         R                  R                  U R                  5      U l        g g g s  snf s  snf )N>   r   try-reporI   )ospathexistsconfigabspathcommandfilescommit_msg_filenamerepor   get_rootchdirrelpath)argsfilenametoplevels      r)   _adjust_args_and_chdirrY      s   	ww~~dkk""ggoodkk2||**@D

K
Hbggooh/
K
##/')ww(((D$ ||z!bggnnTYY&?&?GGOODII.	||~HHHX''//$++.DK||**@D

K
Hbggooh/
K
##/')ww(((D$ ||z!bggnnTYY&?&?GGOODII.	 '@!% L Ls   ;)J%
)J*c                  ^ U b  U O[         R                  SS  n [        R                  " SS9nUR	                  SSSS[
        R                   3S9  UR                  S	S
9mShU4S jjnU" SSS9n[        U5        UR	                  SSSS9  UR	                  SSSS9  UR	                  SSSS/ SS9  UR	                  SS[        SSS9  U" S S!S9  U" S"S#S9  U" S$S%S9n[        R                  " U5        U" S&S'S9n[        U5        UR	                  S(S)S9  UR	                  S*S+S,S-S.9  [        U5        U" S/S0S9n[        U5        UR	                  S1S2SS3S9  UR	                  S4SS5S9  [        U5        UR	                  S6SS7S9  U" S8S9S9n[        U5        U" S:S;S9n[        U5        U" S<S=S9n	[        U	5        [        U	5        U" S>S?[
        R                   S@3S9  U" SASBS9n
[        U
5        U
R	                  SCSDS9  U
R	                  SESFSGS9  [        U
5        U" SHSIS9n[        U5        [        U5        U" SJSKS9nUR	                  SLSMSN9  U" SOSPS9nUR	                  SLSMSN9  TR                  SSQS9nUR	                  SRSSSTSU9  TR                  SV5      n[!        U5        [        U5        UR	                  SWSXSY9  UR	                  SZ5        UR	                  S[SS\9  UR	                  S][        R"                  S^9  [%        U 5      S_:X  a  S</n UR'                  U 5      nUR(                  S:X  a/  UR*                  (       a  UR'                  UR*                  S`/5        O"UR(                  S:X  a  UR'                  S`/5        [-        5          [/        UR0                  5         [2        R4                  " 5         [7        5       nUR(                  [8        ;  a&  [;        U5        UR=                  UR>                  5        UR(                  S:X  aV  [A        UR>                  URB                  (       + URD                  URF                  URH                  Sa9sS S S 5        sS S S 5        $ UR(                  S :X  a  [K        U5      sS S S 5        sS S S 5        $ UR(                  S":X  a  [M        U5      sS S S 5        sS S S 5        $ UR(                  S$:X  a(  [        RN                  " U5      sS S S 5        sS S S 5        $ UR(                  SV:X  a`  [Q        UUR>                  UR0                  URR                  URT                  URV                  URX                  SS  Sb9sS S S 5        sS S S 5        $ UR(                  S/:X  aR  [[        UR>                  UUR\                  UR^                  UR`                  URb                  Sc9sS S S 5        sS S S 5        $ UR(                  S&:X  aG  [e        UR>                  UURf                  UR\                  URb                  Sd9sS S S 5        sS S S 5        $ UR(                  S8:X  a(  [a        UR>                  U5      sS S S 5        sS S S 5        $ UR(                  S::X  a'  [i        UR>                  5      sS S S 5        sS S S 5        $ UR(                  S<:X  a)  [k        UR>                  UU5      sS S S 5        sS S S 5        $ UR(                  S>:X  a  [m        5       sS S S 5        sS S S 5        $ UR(                  SA:X  a  [o        U5      sS S S 5        sS S S 5        $ UR(                  SH:X  a0  [q        UR>                  UR\                  Se9sS S S 5        sS S S 5        $ UR(                  SJ:X  a'  [s        URt                  5      sS S S 5        sS S S 5        $ UR(                  SO:X  a'  [w        URt                  5      sS S S 5        sS S S 5        $ [y        SfUR(                   Sg35      e! , (       d  f       O= fS S S 5        g ! , (       d  f       g = f)iN   r@   )progz-Vz	--versionversionz	%(prog)s )r1   r]   rO   )r2   r#   c               <   > TR                  XS9n[        U5        U$ )NrB   )
add_parserr   )namer#   r(   
subparserss      r)   _add_cmdmain.<locals>._add_cmd   s#    &&t&7 r+   r	   z<Auto-update pre-commit config to the latest repos' versions.rB   z--bleeding-edger:   zbUpdate to the bleeding edge of `HEAD` instead of the latest tagged version (the default behavior).r>   z--freezez3Store "frozen" hashes in `rev` instead of tag namesz--reporeposr.   REPOz?Only update this repository -- may be specified multiple times.)r2   r1   metavarr"   r#   z-jz--jobsz1Number of threads to use.  (default %(default)s).)rA   r"   r#   r
   zClean out pre-commit files.r   zClean unused cached repos.r   z.Composable tools for rare use in hook `entry`.r   zWInstall hook script in a directory intended for use with `git config init.templateDir`.	directoryz0The directory in which to write the hook script.z--no-allow-missing-configstore_falseallow_missing_configz6Assume cloned repos should have a `pre-commit` config.)r1   r2   r#   r   zInstall the pre-commit script.z-fz--overwritez1Overwrite existing hooks / remove migration mode.z--install-hookszMWhether to install hook environments for all environments in the config file.z--allow-missing-configzWWhether to allow a missing `pre-commit` configuration file or exit with a failure code.zinstall-hookszInstall hook environments for all environments in the config file.  You may find `pre-commit install --install-hooks` more useful.zmigrate-configz4Migrate list configuration to new map configuration.r   z
Run hooks.r   zProduce a sample z filerI   z?Try the hooks in a repository, useful for developing new hooks.rR   z Repository to source hooks from.z--refz--revzQManually select a rev to run against, otherwise the `HEAD` revision will be used.r   z Uninstall the pre-commit script.r   z&Validate .pre-commit-config.yaml files	filenamesr?   )r9   r    z%Validate .pre-commit-hooks.yaml filesz!Show help for a specific command.help_cmdr7   zCommand to show help for.r8   z	hook-implr-   Tr<   z
--hook-dirz--skip-on-missing-configr;   rest)r2   r9   r   z--help)	tags_onlyfreezerd   jobs)rM   color	hook_typehook_dirskip_on_missing_configrV   )r/   	overwritehooksrs   )r/   rs   )config_filer/   zCommand z not implemented.)r`   strr#   rw   returnargparse.ArgumentParser)>sysargvargparseArgumentParserr$   r%   VERSIONadd_subparsersr*   intr   add_parsersr4   rG   r&   r_   r   	REMAINDERlen
parse_argsrO   rk   r   r   rp   r   check_for_cygwin_mismatchr   COMMANDS_NO_GITrY   mark_config_usedrM   r	   bleeding_edgern   rd   ro   r
   r   implr   rq   rr   rs   rl   r   r/   rt   r   ri   r   rg   r   r   r   r   r   r   rj   r   NotImplementedErrorAssertionError)r{   r(   rb   autoupdate_parserhazmat_parserinit_templatedir_parserinstall_parserinstall_hooks_parsermigrate_config_parser
run_parsertry_repo_parseruninstall_parservalidate_config_parservalidate_manifest_parserr#   hook_impl_parserrV   storera   s                     @r)   mainr      s   #4!"D$$,7F kAII;'   &&I&6J
 !K ()"",5 #  ""<B #  ""wxN #  ""hS!@ # 
 W89T45GM }%&- ./((L )  ((##E	 )  12i.NON~&mL@    ,"    .) +    $ +,$C ,-%l3Jz"Z _%6q}}oU#KLNO '  7 !    % !  _%< '(*+% H ''3'?'"I  ))+S)A   8 ! D 	j2MN ",,[9%&'(!!-$!?!!,/!!"< "  !!vX5G5G!H 4yA~wT"D||v$--4==(34		8*%	/$**5%%'<<."4(""4;;/<<<'"000{{jjYY 65" \\W$<% 65& \\T!e9) 65* \\X%;;t$- 65. \\[({{jj..'+'B'BYYqr]1 65B \\Y&U??..(('+'@'@E 65R \\//#UDNN??'+'@'@U 65^ \\_, e4a 65b \\--!$++.e 65f \\U"t{{E40i 65j \\_, ?m 65n \\Z'D>q 65r \\[( KK??u 65| \\.."4>>2 65@ \\00$T^^4C 65F &4<<.(9: G 65s   
_= B-_#	_= _#:	_=_#'	_=:%_#	_=2A_#	_="A_#1	_=A_#	_=%_# 	_=$_#7	_=
&_#0	_=_#	_=/_#		_=-_#		_=$_# 	_=$_#7	_=
_##
_1	-_==
`__main__)r(   ry   rx   None)rV   zargparse.Namespacerx   r   )N)r{   zSequence[str] | Nonerx   r   )>
__future__r   r|   loggingrJ   rz   collections.abcr   pre_commit.constants	constantsr%   r   r   r   pre_commit.colorr   pre_commit.commandsr   pre_commit.commands.autoupdater	   pre_commit.commands.cleanr
   pre_commit.commands.gcr   pre_commit.commands.hook_implr   $pre_commit.commands.init_templatedirr   %pre_commit.commands.install_uninstallr   r   r   "pre_commit.commands.migrate_configr   pre_commit.commands.runr   !pre_commit.commands.sample_configr   pre_commit.commands.try_repor   #pre_commit.commands.validate_configr   %pre_commit.commands.validate_manifestr   pre_commit.error_handlerr   pre_commit.logging_handlerr   pre_commit.storer   	getLoggerloggerenvironpopr   r*   r4   rG   rY   r   __name__
SystemExit r+   r)   <module>r      s    "   	 
 $      - & 5 + % 3 A 9 ? ; = ' ; 1 ? C 2 6 " 
		<	( 

$d + 

!4 (l^/6x
v z
TV
 r+   