--- target: obj-x86_64-pc-linux-gnu # It is used by 'mach static-analysis' and 'mozreview static-analysis bot' # in order to have consistency across the used checkers. # All the clang checks used by the static-analysis tools. # # To add a new checker: # 1. Add it in this file # 2. Create a C/C++ test case in tools/clang-tidy/test/ reproducing the # warning/error that the checker will detect # 3. Run './mach static-analysis autotest -d' to create the reference # 4. Check the json file in tools/clang-tidy/test/ # 5. Commit this file + the .cpp test case + the json result platforms: - linux64 - macosx64 - win32 - win64 # Minimum clang-tidy version that is required for all the following checkers # to work properly. min_clang_tidy: "7.0.0" clang_checkers: - name: -* publish: !!bool no - name: bugprone-argument-comment - name: bugprone-assert-side-effect - name: bugprone-bool-pointer-implicit-conversion - name: bugprone-forward-declaration-namespace - name: bugprone-incorrect-roundings - name: bugprone-integer-division - name: bugprone-macro-parentheses - name: bugprone-macro-repeated-side-effects - name: bugprone-misplaced-widening-cast - name: bugprone-multiple-statement-macro # Incompatible with our code base, see bug 1496379. publish: !!bool no - name: bugprone-sizeof-expression - name: bugprone-string-constructor - name: bugprone-string-integer-assignment - name: bugprone-suspicious-memset-usage - name: bugprone-suspicious-missing-comma - name: bugprone-suspicious-semicolon - name: bugprone-suspicious-string-compare - name: bugprone-swapped-arguments - name: bugprone-unused-raii - name: bugprone-use-after-move - name: clang-analyzer-core.CallAndMessage - name: clang-analyzer-core.DivideZero - name: clang-analyzer-core.NonNullParamChecker - name: clang-analyzer-core.NullDereference - name: clang-analyzer-core.UndefinedBinaryOperatorResult - name: clang-analyzer-core.uninitialized.Assign - name: clang-analyzer-core.uninitialized.Branch - name: clang-analyzer-cplusplus.NewDelete - name: clang-analyzer-cplusplus.NewDeleteLeaks - name: clang-analyzer-deadcode.DeadStores - name: clang-analyzer-security.FloatLoopCounter - name: clang-analyzer-security.insecureAPI.bcmp - name: clang-analyzer-security.insecureAPI.bcopy - name: clang-analyzer-security.insecureAPI.bzero - name: clang-analyzer-security.insecureAPI.getpw # We don't add clang-analyzer-security.insecureAPI.gets here; it's deprecated. - name: clang-analyzer-security.insecureAPI.mkstemp - name: clang-analyzer-security.insecureAPI.mktemp - name: clang-analyzer-security.insecureAPI.rand publish: !!bool no - name: clang-analyzer-security.insecureAPI.strcpy publish: !!bool no - name: clang-analyzer-security.insecureAPI.UncheckedReturn - name: clang-analyzer-security.insecureAPI.vfork - name: clang-analyzer-unix.Malloc - name: clang-analyzer-unix.cstring.BadSizeArg - name: clang-analyzer-unix.cstring.NullArg - name: misc-non-copyable-objects - name: misc-redundant-expression - name: misc-unused-alias-decls - name: misc-unused-using-decls - name: modernize-avoid-bind restricted-platforms: - win32 - win64 - name: modernize-loop-convert - name: modernize-raw-string-literal - name: modernize-redundant-void-arg publish: !!bool no - name: modernize-shrink-to-fit - name: modernize-use-auto # Controversial, see bug 1371052. publish: !!bool no - name: modernize-use-bool-literals - name: modernize-use-equals-default - name: modernize-use-equals-delete - name: modernize-use-nullptr - name: modernize-use-override # Too noisy because of the way how we implement NS_IMETHOD. See Bug 1420366. publish: !!bool no - name: mozilla-* - name: performance-faster-string-find - name: performance-for-range-copy - name: performance-implicit-conversion-in-loop - name: performance-inefficient-algorithm restricted-platforms: - linux64 - macosx64 - name: performance-inefficient-string-concatenation - name: performance-inefficient-vector-operation - name: performance-move-const-arg - name: performance-move-constructor-init - name: performance-noexcept-move-constructor - name: performance-type-promotion-in-math-fn - name: performance-unnecessary-copy-initialization - name: performance-unnecessary-value-param - name: readability-braces-around-statements # Note: this can be loosened up by using the ShortStatementLines option - name: readability-container-size-empty - name: readability-delete-null-pointer - name: readability-else-after-return - name: readability-implicit-bool-conversion # On automation the config flags act strange. Please see Bug 1500241. publish: !!bool no config: - key: AllowIntegerConditions # The check will allow conditional integer conversions. value: 1 - key: AllowPointerConditions # The check will allow conditional pointer conversions. value: 1 - name: readability-inconsistent-declaration-parameter-name - name: readability-misleading-indentation - name: readability-non-const-parameter - name: readability-redundant-control-flow - name: readability-redundant-smartptr-get - name: readability-redundant-string-cstr - name: readability-redundant-string-init - name: readability-static-accessed-through-instance - name: readability-simplify-boolean-expr - name: readability-uniqueptr-delete-release # We don't publish the google checkers since we are interested in only having # a general idea how our code complies with the rules added by these checkers. - name: google-build-explicit-make-pair publish: !!bool no - name: google-build-namespaces publish: !!bool no - name: google-build-using-namespace publish: !!bool no - name: google-default-arguments publish: !!bool no - name: google-explicit-constructor publish: !!bool no - name: google-global-names-in-headers publish: !!bool no - name: google-readability-casting publish: !!bool no - name: google-readability-function-size publish: !!bool no - name: google-readability-namespace-comments publish: !!bool no - name: google-readability-todo publish: !!bool no - name: google-runtime-int publish: !!bool no - name: google-runtime-operator publish: !!bool no - name: google-runtime-references publish: !!bool no # Third party files from mozilla-central third_party: tools/rewriting/ThirdPartyPaths.txt