2 #**********************************************************************
3 # Copyright (C) 2024 - The Geeqie Team
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License along
18 # with this program; if not, write to the Free Software Foundation, Inc.,
19 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 #**********************************************************************
23 ## @brief Run clang-tidy on all source files.
26 if [ ! -d ".git" ] || [ ! -d "src" ] || [ ! -f "geeqie.1" ]
28 printf '%s\n' "This is not a Geeqie project folder"
34 secs_start=$(cut --delimiter='.' --fields=1 < /proc/uptime)
35 total=$(find src -name "*.cc" | wc --lines)
40 printf '%d/%d %s\n' "$i" "$total" "$file"
41 clang-tidy --config-file ./.clang-tidy -p ./build "$file" 2>/dev/null
43 secs_now=$(cut --delimiter='.' --fields=1 < /proc/uptime)
45 elapsed_time=$(( secs_now - secs_start ))
46 remaining_files=$(( total - i ))
47 average_time=$(( elapsed_time / i ))
48 estimated=$(( average_time * remaining_files ))
50 printf 'Remaining: %dm:%ds\n' $((estimated%3600/60)) $((estimated%60))
52 $(find src -name "*.cc" | sort)