관리-도구
편집 파일: hook_impl.cpython-38.pyc
U ,�e�$ � @ sh d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dl m Z d dlmZ d dl mZ d dlmZ dZd d d dd�d d�Zdd ddd�dd�Zdddddddddddddddd�d dddddddddddddddddd�dd�Zd dd�dd�Zdd dd d!�d"d#�Zd$d%d d d d$d$d&d'�Zd d dd(�d)d*�Zd dd dd d+�d,d-�Zd.d dd d dd dd/�d0d1�ZdS )2� )�annotationsN)�Sequence)�run)� envcontext)� normalize_cmd)�StoreZ(0000000000000000000000000000000000000000�strz Sequence[str]ztuple[int, bytes])� hook_type�hook_dir�args�returnc C s� t j�d�rtd| � d���| dkr2tjj�� }nd}t j� || � d��}t � |t j�s`d|fS td��0 t |f|��}tj||d �j|fW 5 Q R � S Q R X d S ) N�PRE_COMMIT_RUNNING_LEGACYz_bug: pre-commit's script is installed in migration mode run `pre-commit install -f --hook-type zX` to fix this Please report this bug at https://github.com/pre-commit/pre-commit/issues�pre-push� z.legacyr ))r �1)�input)�os�environ�get� SystemExit�sys�stdin�buffer�read�path�join�access�X_OKr r � subprocessr � returncode)r r r r Zlegacy_hook�cmd� r! �K/opt/hc_python/lib/python3.8/site-packages/pre_commit/commands/hook_impl.py�_run_legacy s � r# �int�bool�None)�retv�config�skip_on_missing_configr c C sP t j�|�sL|st �d�r4td|� d�� t| ��ntd|� d�� td��d S )NZPRE_COMMIT_ALLOW_NO_CONFIG�`z/` config file not found. Skipping `pre-commit`.zNo z� file was found - To temporarily silence this, run `PRE_COMMIT_ALLOW_NO_CONFIG=1 git ...` - To permanently silence this, install pre-commit with the --allow-missing-config option - To uninstall pre-commit run `pre-commit uninstall`� )r r �isfile�getenv�printr )r'