--- /dev/null
+#/*
+# * Copyright (C) 2023 The Geeqie Team
+# *
+# * Author: Colin Clark
+# *
+# * This program is free software; you can redistribute it and/or modify
+# * it under the terms of the GNU General Public License as published by
+# * the Free Software Foundation; either version 2 of the License, or
+# * (at your option) any later version.
+# *
+# * This program is distributed in the hope that it will be useful,
+# * but WITHOUT ANY WARRANTY; without even the implied warranty of
+# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# * GNU General Public License for more details.
+# *
+# * You should have received a copy of the GNU General Public License along
+# * with this program; if not, write to the Free Software Foundation, Inc.,
+# * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# */
+
+Checks: >
+ -*,
+ bugprone-*,
+ misc-*,
+ modernize-*,
+ performance-*,
+ portability-*,
+ readability-*,
+ -bugprone-easily-swappable-parameters,
+ -misc-const-correctness,
+ -modernize-avoid-c-arrays,
+ -modernize-macro-to-enum,
+ -modernize-use-trailing-return-type,
+ -performance-no-int-to-ptr,
+ -readability-braces-around-statements,
+ -readability-else-after-return,
+ -readability-function-cognitive-complexity,
+ -readability-identifier-length,
+ -readability-implicit-bool-conversion,
+ -readability-isolate-declaration,
+ -readability-magic-numbers,
+ -readability-qualified-auto
else
summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
+
+# Code correctness checks
+if running_from_git
+ clang_tidy_exe = find_program('clang-tidy', required : false)
+ if clang_tidy_exe.found()
+ git_exe = find_program('git', required : true)
+ modified_file_list = run_command(git_exe, 'diff', '--name-only', check: true)
+ modified_files = modified_file_list.stdout().strip().split('\n')
+
+ foreach modified_file : modified_files
+ if modified_file.endswith('.cc')
+ modified_file_path = '@0@'.format(modified_file)
+ path_array = modified_file_path.split('/')
+ modified_file_name = path_array[path_array.length() - 1]
+ modified_file_full_path = join_paths(meson.project_source_root(), modified_file)
+
+ test('Code Correctness_ ' + modified_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', modified_file_full_path], timeout : 100)
+ endif
+ endforeach
+
+ summary({'Code Correctness' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
+ else
+ summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
+ endif
+else
+ summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
+endif