Refactoring: Moved more storage check parameters from unsorted.py to dedicated module...
[check_mk.git] / tests / find-python-files
blob23d65c96677fc4adf594f5b34a605258fb122bfa
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 # Tests contain some very large data structures (e.g.
27 # tests/unit/checks/test_docker_parse_node_images.py). Skip them for the
28 # moment because they make YAPF run more than 60 minutes instead of 8 minutes
29 #SEARCH+=" tests"
30 SEARCH+=" web/app"
31 SEARCH+=" werk"
33 # Resolve search paths to real paths before the search for performance reasons
34 REAL_SEARCH=$(realpath $SEARCH)
36 # while read F is used to deal with files containing whitespaces
37 find $REAL_SEARCH -name .venv -prune -o -type f -print | sort | while read F; do
38 if [[ "$F" == *.py ]] || head -n 1 "$F" | grep -q '^#!.*python$' >/dev/null 2>&1; then
39 echo "$F"
41 done