ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/dodgy/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/dodgy/__pycache__/run.cpython-311.pyc

�

�܋fS���ddlZddlZddlZddlZddlZddlmZddlmZd�dD��Z	d�Z
dd�Zd
d	�Zdd
�Z
edkre
��dSdS)�N)�ArgumentParser)�
check_filec	��g|]<}tj|dtjtjj��iz����=S)�sep)�re�compile�escape�os�pathr��.0�patts  �Z/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/dodgy/run.py�
<listcomp>r
sJ��	�	�	���J�t�u�b�i����4�4�5�5�6�6�	�	�	�)z(^|%(sep)s)\.[^\.]z^tests?%(sep)s?z%(sep)stests?(%(sep)s|$)z_tests?(%(sep)s|$)c��g}tj|��D]>\}}}|D]5}|�tj�||�����6�?|S�N)r
�walk�appendr�join)�
start_path�	filepaths�root�_�files�	file_names      r�
list_filesrsg���I��'�*�-�-�<�<���a���	<�	<�I����R�W�\�\�$�	�:�:�;�;�;�;�	<��rc	�B��g}|pg}d�|D��}|tz
}t|��}|D]�}tj�||���t�fd�|D����r�>t
j|��}|d�|d�d��s�v	t|��D].}|�
�|d|d|dd����/��#t$r-}td�
||����Yd}~��d}~wwxYw|S)	Nc�6�g|]}tj|����S�)rrrs  rrzrun_checks.<locals>.<listcomp>"s"��>�>�>��B�J�t�$�$�>�>�>rc�:��g|]}|������Sr )�search)r
�ignore�relpaths  �rrzrun_checks.<locals>.<listcomp>(s%���B�B�B�6��
�
�g�&�&�B�B�Brrztext/��)r�line�code�messagezUnable to read {!r}: {})�IGNORE_PATHSrr
rr$�any�	mimetypes�
guess_type�
startswithrr�UnicodeDecodeError�print�format)	�	directory�ignore_paths�warningsr�filepath�mimetype�	msg_parts�errr$s	        @r�
run_checksr9sy����H��%�2�L�>�>��>�>�>�L��L� �L��9�%�%�I��C�C���'�/�/�(�I�6�6���B�B�B�B�\�B�B�B�C�C�	���'��1�1���A�;��h�q�k�&<�&<�W�&E�&E���	C�'��1�1�
�
�	���� '� )�!�� )�!��#,�Q�<�	������
��"�	C�	C�	C��+�2�2�8�S�A�A�B�B�B�B�B�B�B�B�����	C�����Os�&>C%�%
D�/#D�DFc��ttj��|���}tjd|id���}t
j�|dz��|rtjd��tj|rdnd��dS)N)r3r4r&)�indent�
rr%)	r9r
�getcwd�json�dumps�sys�stdout�write�exit)r3�	zero_exitr4�outputs    r�runrFAs����"�)�+�+�L�A�A�A�H�
�Z��X�.�q�
9�
9�
9�F��J���V�d�]�#�#�#����������H�(�
!�Q�Q��"�"�"�"�"rc
�&�|ptj}d}td|���}|�dddtdddd	�
��|�ddd
dd���|�|��\}}t
|j|j���dS)Nz�A very basic tool to run against your codebase to search for "dodgy" looking values. It is a series of simple regular expressions designed to detect things such as accidental SCM diff checkins, or passwords/secret keys hardcoded into files.�dodgy)�descriptionz--ignore-pathsz-i�+r#�IGNORE_PATHzPaths to ignore)�nargs�type�dest�default�metavar�helpz--zero-exitz-0rDz�Dodgy will exit with a code of 1 if problems are found. This flag ensures that it always returns with 0 unless an exception is raised.�
store_true)rNrQ�action)r3rD)	r@�argvr�add_argument�str�parse_known_argsrFr#rD)rT�desc�parser�argsrs     r�mainr[Ks�����3�8�D�	W�	�
�G��
6�
6�
6�F�
������
�
���
��	�	�	������
�V�������%�%�d�+�+�G�D�!��T�[�D�N�;�;�;�;�;�;r�__main__r)NF)r>r,r
rr@�argparser�dodgy.checksrr*rr9rFr[�__name__r rr�<module>r`s�����������	�	�	�	�	�	�	�	�
�
�
�
�#�#�#�#�#�#�#�#�#�#�#�#�	�	��	�	�	����� � � � �F#�#�#�#�<�<�<�<�<�z����D�F�F�F�F�F��r

Zerion Mini Shell 1.0