diff options
-rw-r--r-- | .clang-tidy | 113 | ||||
-rw-r--r-- | Makefile | 13 |
2 files changed, 126 insertions, 0 deletions
diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000..7d7f4ca --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,113 @@ +--- +Checks: > + -*, + boost-use-to-string, + # M-Link checks to enable later + # clang-diagnostic-*, + # misc-definitions-in-headers, + # misc-forwarding-reference-overload, + # misc-incorrect-roundings, + # misc-lambda-function-name, + # misc-macro-repeated-side-effects, + # misc-misplaced-const, + # misc-misplaced-widening-cast, + # misc-new-delete-overloads, + # misc-non-copyable-objects, + # misc-redundant-expression, + # misc-sizeof-container, + # misc-sizeof-expression, + # misc-static-assert, + # misc-string-compare, + # misc-string-integer-assignment, + # misc-string-literal-with-embedded-nul, + # misc-suspicious-enum-usage, + # misc-suspicious-missing-comma, + # misc-suspicious-semicolon, + # misc-suspicious-string-compare, + # misc-swapped-arguments, + # misc-throw-by-value-catch-by-reference, + # misc-unconventional-assign-operator, + # misc-undelegated-constructor, + # misc-uniqueptr-reset-release, + # misc-unused-alias-decls, + # misc-unused-raii, + # misc-unused-using-decls, + # modernize-avoid-bind, + # modernize-deprecated-headers, + # modernize-loop-convert, + # modernize-make-shared, + # modernize-make-unique, + # modernize-raw-string-literal, + # modernize-redundant-void-arg, + # modernize-replace-auto-ptr, + # modernize-replace-random-shuffle, + # modernize-return-braced-init-list, + # modernize-shrink-to-fit, + # modernize-unary-static-assert, + # modernize-use-bool-literals, + # modernize-use-default-member-init, + # modernize-use-equals-delete, + # modernize-use-noexcept, + # modernize-use-transparent-functors, + # modernize-use-uncaught-exceptions, + # modernize-use-using, + # performance-faster-string-find, + # performance-implicit-conversion-in-loop, + # performance-inefficient-algorithm, + # performance-inefficient-string-concatenation, + # performance-inefficient-vector-operation, + # performance-move-constructor-init, + # performance-noexcept-move-constructor, + # performance-type-promotion-in-math-fn, + # performance-unnecessary-copy-initialization, + # readability-avoid-const-params-in-decls, + # readability-delete-null-pointer, + # readability-deleted-default, + # readability-function-size, + # readability-identifier-naming, + # readability-inconsistent-declaration-parameter-name, + # readability-misleading-indentation, + # readability-misplaced-array-index, + # readability-non-const-parameter, + # readability-redundant-control-flow, + # readability-redundant-declaration, + # readability-redundant-function-ptr-dereference, + # readability-redundant-member-init, + # readability-redundant-smartptr-get, + # readability-redundant-string-cstr, + # readability-redundant-string-init, + # readability-simplify-subscript-expr, + # readability-static-accessed-through-instance, + # readability-static-definition-in-anonymous-namespace, + # readability-string-compare, + # readability-uniqueptr-delete-release +# Fix code and enable checks: +# misc-unused-parameters, +# modernize-pass-by-value, +# modernize-use-auto, +# modernize-use-emplace, +# modernize-use-equals-default, +# modernize-use-nullptr, +# modernize-use-override, +# performance-for-range-copy, +# performance-move-const-arg, +# performance-unnecessary-value-param, +# readability-braces-around-statements, +# readability-container-size-empty, +# readability-else-after-return, +# readability-implicit-bool-conversion, +# readability-named-parameter, +# readability-redundant-smartptr-get, +# readability-simplify-boolean-expr, +WarningsAsErrors: '*' +HeaderFilterRegex: '(Swift|Swiften|Sluift)/.*' +AnalyzeTemporaryDtors: false +CheckOptions: + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: readability-identifier-naming.PrivateMemberSuffix + value: '_' diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..d72f311 --- /dev/null +++ b/Makefile @@ -0,0 +1,13 @@ +.PHONY: all +all: build.ninja + ninja + +.PHONY: clang-tidy +clang-tidy: compile_commands.json + ninja -t targets all | grep cxx | grep -v 3rdParty | sed -e's/\.o: cxx/.cpp/' | xargs -n 1 clang-tidy + +compile_commands.json: build.ninja + ninja -t compdb cxx > compile_commands.json + +build.ninja: + ./BuildTools/scons2ninja.py check=1 build_examples=0 |