
    Vh@                    T    d Z ddlmZ ddlZddlZddlZddlZd Zedk(  r e        yy)z2Check shebangs, execute bits and byte order marks.    )annotationsNc            
        t        g d      } t        g d      }dddd}d}t        j                  dd xs, t        j                  j	                         j                         D ]  }t        |d	      5 }|j                         j                         }t        j                  |      j                  }t        j                  t        j                  z  t        j                  z  |z  }|r|j                  d
      sL|rt!        d|ddfz         |D ]*  \  }	}
|j                  |	      st!        d|dd|
fz          n 	 ddd       d}d}t        j"                  j%                  |      }|j                  d      rd}nt'        j(                  d|      rd}nt'        j(                  d|      rd}n|dk(  rnt'        j(                  d|      rn|j                  d      r	 ddd       |j                  d      s|j                  d      r1|rt!        d|ddfz         |rt!        d|ddfz         	 ddd       |j                  d      s|j                  d      rd}|j+                  d      sd|v s|dv rd}n|j                  d      rd}|r|rt!        d |ddfz         t        j"                  j-                  |      d   }|j/                  |      }d!j1                  |D cg c]  }d"|z  	 c}      }|r$||k(  r	 ddd       t!        d#|dd||fz         n1t!        d$|dd||fz         n|r|}n| }||vrt!        d%|dd|fz         ddd        yc c}w # 1 sw Y   xY w)&zMain entry point.)s   #!/bin/bash -eus   #!/bin/bash -eux	   #!/bin/sh   #!/usr/bin/env bashs   #!/usr/bin/env fishs   #!/usr/bin/env pwsh   #!/usr/bin/env pythons   #!/usr/bin/make -f)r   r   r   s   #!/usr/bin/pythons   #!powershell) z.pyz.ps1))s     zUTF-32 (BE))s     zUTF-32 (LE))s   zUTF-16 (BE))s   zUTF-16 (LE))s   ﻿zUTF-8   Nrbs   #!z7%s:%d:%d: file without shebang should not be executabler   z/%s:%d:%d: file starts with a %s byte order markFzlib/ansible/modules/Tz$^test/support/[^/]+/plugins/modules/zP^test/support/[^/]+/collections/ansible_collections/[^/]+/[^/]+/plugins/modules/z?test/lib/ansible_test/_util/target/cli/ansible_test_cli_stub.pyz^lib/ansible/cli/[^/]+\.pyz	examples/zlib/z	test/lib/z"%s:%d:%d: should not be executablez#%s:%d:%d: should not have a shebangztest/integration/targets/ztests/integration/targets/z/libraryz/plugins/modules)z;test/integration/targets/module_precedence/lib_no_extensionz=test/integration/targets/module_precedence/lib_with_extensionzplugins/modules/z)%s:%d:%d: module should not be executablez or z"%s"z4%s:%d:%d: expected module shebang "%s" but found: %sz4%s:%d:%d: expected module extension %s but found: %sz+%s:%d:%d: unexpected non-module shebang: %s)setsysargvstdinread
splitlinesopenreadlinestriposstatst_modeS_IXUSRS_IXGRPS_IXOTH
startswithprintpathdirnameresearchendswithsplitextgetjoin)standard_shebangsintegration_shebangsmodule_shebangsbyte_order_marksr   path_fdshebangmode
executablemarkname	is_moduleis_integrationr   extexpected_shebangkexpected_extalloweds                      g/home/dcms/DCMS/lib/python3.12/site-packages/ansible_test/_util/controller/sanity/code-smell/shebang.pymainr6   
   s    	 	     !#O =		 0 ; ; = La$ K	a&&(..0G774=((D,,5DLJ'"4"4U";SW[]^`aVbbc"2 JD$))$/OSWYZ\]_cRdde
 K	a K	a  I"Nggood+G56 	A4H 	most 	ZZ8$?-AK	a K	aB (DOOK,H>$1MN?4A,NOQK	a K	aR !<=QmAn!%##J/3E3PT[ ` U
 !%I!34 	EqRSTUgg&&t,Q/#2#6#6s#; %{{+P1FQJ+PQ#"22 K	a K	aB PTXZ[]^`prySzz{PTXZ[]^`lnqSrrs!2G/G')G4QRTUW^J__`WK	a K	aLax ,QwK	a K	asA   4B2M!'M!BM!)A	M!<B*M!&M2M!AM!M!!M+	__main__)	__doc__
__future__r   r   r   r   r   r6   __name__     r5   <module>r=      s3    8 " 	 	  
nab zF r<   