加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.clang-tidy 3.49 KB
一键复制 编辑 原始数据 按行查看 历史
Ashish Thakkar 提交于 2021-07-03 15:59 . Clang tidy changes (w/ KY)
Checks: >
*,
-readability-magic-numbers,
-readability-implicit-bool-conversion,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-special-member-functions,
-hicpp-signed-bitwise,
-hicpp-special-member-functions,
-modernize-use-trailing-return-type,
-llvmlibc-restrict-system-libc-headers,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,
-fuchsia-overloaded-operator,
-fuchsia-default-arguments-calls,
-altera-struct-pack-align,
-altera-unroll-loops,
-altera-id-dependent-backward-branch,
-llvm-header-guard,
-bugprone-easily-swappable-parameters,
-bugprone-narrowing-conversions,
# google-*,
# readability-*,
# portability-*,
# performance-*,
# bugprone-*,
# misc-*,
# modernize-*,
# llvmlibc-*,
CheckOptions:
- { key: readability-identifier-naming.LocalVariableCase, value: lower_case }
- { key: readability-identifier-naming.FunctionCase, value: CamelCase }
- { key: readability-identifier-naming.PublicMemberCase, value: lower_case }
- { key: readability-identifier-naming.PublicMemberSuffix, value: "" }
- { key: readability-identifier-naming.MemberCase, value: lower_case }
- { key: readability-identifier-naming.MemberSuffix, value: "_" }
- { key: readability-identifier-naming.StaticConstantCase, value: CamelCase }
- { key: readability-identifier-naming.StaticConstantPrefix, value: "k" }
- { key: readability-identifier-naming.EnumConstantCase, value: CamelCase }
- { key: readability-identifier-naming.EnumConstantPrefix, value: "k" }
WarningsAsErrors: "*"
InheritParentConfig: false
# Here is an explanation for why some of the checks are might need to be disabled:
#
# -google-readability-namespace-comments: the *_CLIENT_NS is a macro, and
# clang-tidy fails to match it against the initial value.
#
# -modernize-use-trailing-return-type: clang-tidy recommends using
# `auto Foo() -> std::string { return ...; }`, we think the code is less
# readable in this form.
#
# -modernize-return-braced-init-list: We think removing typenames and using
# only braced-init can hurt readability.
#
# -modernize-avoid-c-arrays: We only use C arrays when they seem to be the
# right tool for the job, such as `char foo[] = "hello"`. In these cases,
# avoiding C arrays often makes the code less readable, and std::array is
# not a drop-in replacement because it doesn't deduce the size.
#
# -performance-move-const-arg: This warning requires the developer to
# know/care more about the implementation details of types/functions than
# should be necessary. For example, `A a; F(std::move(a));` will trigger a
# warning IFF `A` is a trivial type (and therefore the move is
# meaningless). It would also warn if `F` accepts by `const&`, which is
# another detail that the caller need not care about.
#
# -readability-redundant-declaration: A friend declaration inside a class
# counts as a declaration, so if we also declare that friend outside the
# class in order to document it as part of the public API, that will
# trigger a redundant declaration warning from this check.
#
# -readability-function-cognitive-complexity: too many false positives with
# clang-tidy-12. We need to disable this check in macros, and that setting
# only appears in clang-tidy-13.
#
# -bugprone-narrowing-conversions: too many false positives around
# `std::size_t` vs. `*::difference_type`.
#
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化