Licenses: Updated the list of licenses and added a PDF containing all license texts
[check_mk.git] / tests / find-python-files
blob31ca57a9c37a5054e244644e3931a2b65cafcb05
1 #!/bin/bash
2 # Find and print the absolute paths of all python source code files
3 set -e
5 REPO_PATH=$(dirname $(dirname $(realpath "$0")))
6 cd "$REPO_PATH"
8 SEARCH=
9 SEARCH+=" active_checks"
10 SEARCH+=" agents"
11 SEARCH+=" bin"
12 SEARCH+=" checks"
13 SEARCH+=" cmk"
14 SEARCH+=" cmk_base"
15 SEARCH+=" doc"
16 SEARCH+=" enterprise"
17 SEARCH+=" inventory"
18 SEARCH+=" livestatus"
19 SEARCH+=" managed"
20 SEARCH+=" notifications"
21 # Do not search whole omd/ because it may contain unpacked sub-packages
22 SEARCH+=" omd/packages/cma"
23 SEARCH+=" omd/packages/maintenance"
24 SEARCH+=" omd/packages/omd"
25 SEARCH+=" scripts"
26 SEARCH+=" tests"
27 SEARCH+=" web/app"
28 SEARCH+=" werk"
30 # Resolve search paths to real paths before the search for performance reasons
31 REAL_SEARCH=$(realpath $SEARCH)
33 # while read F is used to deal with files containing whitespaces
34 find $REAL_SEARCH \
35 -name .mypy_cache -prune -o \
36 -name .venv -prune -o \
37 -name test_docker_parse_node_images.py -prune -o \
38 -name typeshed -prune -o \
39 -type f -print | sort | while read F; do
40 if [[ "$F" == *.py ]] || head -n 1 "$F" | grep -q '^#!.*python$' >/dev/null 2>&1; then
41 echo "$F"
43 done