
    Vh                    N    d Z ddlmZ ddlZddlZd ZdddZedk(  r e        yy)	zQTest to verify action plugins have an associated module to provide documentation.    )annotationsNc                 R   t         j                  dd xs, t         j                  j                         j	                         } t               }ddd}ddd}| D ]"  }t        ||      }|s|j                  |       $ | D ]&  }t        ||d      }|s||vst        d	|z         ( y)
zMain entry point.   NTF)zlib/ansible/modules/zplugins/modules/)zlib/ansible/plugins/action/zplugins/action/)z.py)
extensionszA%s: action plugin has no matching module to provide documentation)	sysargvstdinread
splitlinessetget_full_nameaddprint)pathsmodule_namesmodule_prefixesaction_prefixespath	full_names         r/home/dcms/DCMS/lib/python3.12/site-packages/ansible_test/_util/controller/sanity/code-smell/action-plugin-docs.pymainr      s    HHQRL9CIINN,779E5L !%!O (, O
  (!$8	Y'	(  ^!$HM	,6UX\\]	^    c                ~   |j                         D ])  \  }}| j                  |      st        j                  j	                  | |      }|r t        j                  j                  |      }n|}t        j                  j                  |      \  }}t        j                  j                  |      }|dk(  r y|r||vr y|j                  d      r|dd }t        j                  j                  t        j                  j                  |      |      j                  t        j                  j                  d      }|c S  y)zReturn the full name of the plugin at the given path by matching against the given path prefixes, or None if no match is found.__init__N_r   .)items
startswithosr   relpathbasenamesplitextjoindirnamereplacesep)	r   prefixesr   prefixflatrelative_pathr   file_extnames	            r   r   r   %   s     ( ??6"GGOOD&9MGG,,];	)	"$''"2"29"=Ix77##I.Dz!hj8s#ABxRWW__Y%?FNNrww{{\_`I14 r   __main__)N)r   strr'   zdict[str, bool]r   ztuple[str] | Nonereturnz
str | None)__doc__
__future__r   r   r   r   r   __name__ r   r   <module>r4      s0    W " 	 
^:> zF r   