-
Notifications
You must be signed in to change notification settings - Fork 536
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
integrating clang-tidy into openal-soft with cmake (#1005)
* integrating clang-tidy into openal-soft with cmake this changes introduces the integration of Clang-Tidy into the OpenAL-Soft project using CMake. Clang-Tidy is a static code analysis tool that helps identify and fix potential issues in C++ code. The changes in this comment will analyze and apply clang-tidy fixes to the following directories and files: * `al` * `alc` * `common` * `core` * `utils/openal-info.c` (if enabled) * CMake 3.5 or higher [see. CMAKE_EXPORT_COMPILE_COMMANDS](https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html). compatible for current project cmake version. * Clang-Tidy (only required if analysis is executed) 1. Configure OpenAL-Soft with CMake using the desired features and add the `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON` flag to the CMake command line. ex. `cmake -G "MinGW Makefiles" -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_BUILD_TYPE=Release ..` 2. Run Clang-Tidy using the target `clang-tidy-check`. ex. `make clang-tidy-check` 1. The fixes applied by clang-tidy are not guaranteed to be correct. Therefore, it is important to re-compile and test the project after running this target. 2. More checks over clang-tidy can be implemented, but this may prevent the project from compiling. A more comprehensive clang-tidy configuration with lint comments to ignore specific cases can be developed in the future. * improve clang-tidy and apply the source files * `NOLINT` for windows header * cmake and `.clang-tidy` changes * remove ` llvm-include-order` check in `.clang-tidy` * remove `--fix` & `--fix-errors` flags from clang-tidy-check target
- Loading branch information
1 parent
43a2a78
commit 47a5428
Showing
2 changed files
with
141 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
--- | ||
Checks: '-*, | ||
-llvm*, | ||
bugprone-argument-comment, | ||
bugprone-assert-side-effect, | ||
bugprone-assignment-in-if-condition, | ||
bugprone-bad-signal-to-kill-thread, | ||
bugprone-bool-pointer-implicit-conversion, | ||
bugprone-copy-constructor-init, | ||
bugprone-dangling-handle, | ||
bugprone-dynamic-static-initializers, | ||
bugprone-fold-init-type, | ||
bugprone-forward-declaration-namespace, | ||
bugprone-forwarding-reference-overload, | ||
bugprone-implicit-widening-of-multiplication-result, | ||
bugprone-inaccurate-erase, | ||
bugprone-incorrect-roundings, | ||
bugprone-infinite-loop, | ||
bugprone-integer-division, | ||
bugprone-lambda-function-name, | ||
bugprone-macro-repeated-side-effects, | ||
bugprone-misplaced-*, | ||
bugprone-move-forwarding-reference, | ||
bugprone-multiple-statement-macro, | ||
bugprone-narrowing-conversions, | ||
bugprone-no-escape, | ||
bugprone-not-null-terminated-result, | ||
bugprone-parent-virtual-call, | ||
bugprone-posix-return, | ||
bugprone-redundant-branch-condition, | ||
bugprone-reserved-identifier, | ||
bugprone-shared-ptr-array-mismatch, | ||
bugprone-signal-handler, | ||
bugprone-signed-char-misuse, | ||
bugprone-sizeof-*, | ||
bugprone-spuriously-wake-up-functions, | ||
bugprone-standalone-empty, | ||
bugprone-string-*, | ||
bugprone-stringview-nullptr, | ||
bugprone-suspicious-*, | ||
bugprone-swapped-arguments, | ||
bugprone-terminating-continue, | ||
bugprone-throw-keyword-missing, | ||
bugprone-too-small-loop-variable, | ||
bugprone-undefined-memory-manipulation, | ||
bugprone-undelegated-constructor, | ||
bugprone-unhandled-*, | ||
bugprone-unused-*, | ||
bugprone-use-after-move, | ||
bugprone-virtual-near-miss, | ||
bugprone-switch-missing-default-case, | ||
clang-*, | ||
concurrency-thread-canceltype-asynchronous, | ||
cppcoreguidelines-avoid-c-arrays, | ||
cppcoreguidelines-avoid-goto, | ||
cppcoreguidelines-avoid-reference-coroutine-parameters, | ||
cppcoreguidelines-c-copy-assignment-signature, | ||
cppcoreguidelines-explicit-virtual-functions, | ||
cppcoreguidelines-interfaces-global-init, | ||
cppcoreguidelines-narrowing-conversions, | ||
cppcoreguidelines-no-malloc, | ||
cppcoreguidelines-owning-memory, | ||
cppcoreguidelines-prefer-member-initializer, | ||
cppcoreguidelines-pro-bounds-array-to-pointer-decay, | ||
cppcoreguidelines-pro-bounds-pointer-arithmetic, | ||
cppcoreguidelines-pro-type-const-cast, | ||
cppcoreguidelines-pro-type-cstyle-cast, | ||
cppcoreguidelines-pro-type-member-init, | ||
cppcoreguidelines-pro-type-static-cast-downcast, | ||
cppcoreguidelines-pro-type-union-access, | ||
cppcoreguidelines-slicing, | ||
cppcoreguidelines-virtual-class-destructor, | ||
google-build-explicit-make-pair, | ||
misc-homoglyph, | ||
misc-misleading-identifier, | ||
modernize-avoid-*, | ||
modernize-concat-nested-namespaces, | ||
modernize-deprecated-*, | ||
modernize-loop-convert, | ||
modernize-macro-to-enum, | ||
modernize-make-*, | ||
modernize-pass-by-value, | ||
modernize-raw-string-literal, | ||
modernize-redundant-void-arg, | ||
modernize-replace-*, | ||
modernize-return-braced-init-list, | ||
modernize-shrink-to-fit, | ||
modernize-unary-static-assert, | ||
modernize-use-auto, | ||
modernize-use-bool-literals, | ||
modernize-use-default-member-init, | ||
modernize-use-emplace, | ||
modernize-use-equals-*, | ||
modernize-use-nodiscard, | ||
modernize-use-noexcept, | ||
modernize-use-nullptr, | ||
modernize-use-override, | ||
modernize-use-transparent-functors, | ||
modernize-use-uncaught-exceptions, | ||
modernize-use-using, | ||
performance-faster-string-find, | ||
performance-for-range-copy, | ||
performance-inefficient-algorithm, | ||
performance-inefficient-vector-operation, | ||
performance-noexcept-destructor, | ||
performance-unnecessary-copy-initialization, | ||
portability-*, | ||
readability-const-return-type, | ||
readability-container-contains, | ||
readability-container-size-empty, | ||
readability-convert-member-functions-to-static, | ||
readability-delete-null-pointer, | ||
readability-duplicate-include, | ||
readability-else-after-return, | ||
readability-inconsistent-declaration-parameter-name, | ||
readability-make-member-function-const, | ||
readability-misleading-indentation, | ||
readability-misplaced-array-index, | ||
readability-redundant-*, | ||
readability-simplify-subscript-expr, | ||
readability-static-definition-in-anonymous-namespace, | ||
readability-string-compare, | ||
readability-uniqueptr-delete-release, | ||
readability-use-anyofallof, | ||
readability-use-std-min-max' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters