-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.clang-tidy
118 lines (114 loc) · 5.69 KB
/
.clang-tidy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
# SPDX-License-Identifier: MIT
#
# Copyright (C) 2020 Roman Gilg <[email protected]>
WarningsAsErrors: "*"
# Following checks are disabled:
#
# altera-unroll-loops: Lots of warnings that would lead to premature optimization.
# bugprone-easily-swappable-parameters: Wrapping libwayland API makes this often necessary.
# cert-dcl50-cpp: We need C-style variadic functions for message posting to the
# libwayland C-library.
# cppcoreguidelines-non-private-member-variables-in-classes: We use public member variables in our
# pimpl-classes extensively. TODO: Could be enabled for API classes only or all Private classes be
# transformed into structs.
# cppcoreguidelines-pro-bounds-array-to-pointer-decay: Need array decay for C-style variadic
# function.
# cppcoreguidelines-pro-type-member-init: Produces false positives with template classes, see
# https://stackoverflow.com/q/55569776.
# cppcoreguidelines-pro-type-vararg: See cert-dcl50-cpp.
# fuchsia-default-arguments-calls: We allow default arguments.
# fuchsia-default-arguments-declarations: We allow default arguments.
# fuchsia-overloaded-operator: We overload | for enum classes through Q_DECLARE_OPERATORS_FOR_FLAGS.
# fuchsia-trailing-return: False positive on some templated ctors (here Server::Wayland::Bind)
# google-build-using-namespace: We do allow using namespaces for now. Might make sense to
# reevaluate this decision at some point in the future.
# google-readability-namespace-comments: Often unnecessary verbose, with C++17 namespaces there are
# not many braces after all.
# google-runtime-references: We generally allow reference parameter passing as is common in C++.
# hicpp-member-init: See cppcoreguidelines-pro-type-member-init.
# hicpp-no-array-decay: See cppcoreguidelines-pro-bounds-array-to-pointer-decay.
# hicpp-vararg: Same as cppcoreguidelines-pro-type-vararg.
# llvm-header-guard: We use #pragma once.
# llvm-namespace-comment: Same as google-readability-namespace-comments.
# llvm-qualified-auto: We use auto without qualifiers when not needed like C++ Core Guiedelines do.
# llvmlibc-callee-namespace: We don't require llvm-libc.
# llvmlibc-implementation-in-namespace: We don't require llvm-libc.
# llvmlibc-inline-function-decl: We don't require llvm-libc.
# llvmlibc-restrict-system-libc-headers: We don't require llvm-libc.
# misc-non-private-member-variables-in-classes: See
# cppcoreguidelines-non-private-member-variables-in-classes.
# modernize-use-nodiscard: Putting the nodiscard qualifier at every little getter seems
# weird. Other C++ libraries also don't seem to do that. For now disable it.
# modernize-use-trailing-return-type: The non-trailing return type style is
# easier to read and is preferred.
# readability-implicit-bool-conversion: We use it quite often, it does not really
# improve the readability to explicitly cast everywhere.
# readability-qualified-auto: Same as llvm-qualified-auto.
# readability-use-anyofallof: Requires them also where a normal for-loop is more readable.
#
# Temporarily suppress (might be possilbe to remove or limit to certain subdirectories later on):
# altera-struct-pack-align: Qt macros like Q_OBJECT fail.
# cppcoreguidelines-macro-usage: We currently still depend on some macros in Output implementation
# and some other classes where the Qt functionality can't be easily migrated to templates.
# cppcoreguidelines-owning-memory: We have yet to fully define a structure without the need of raw
# owning pointers. This is a long-term goal that needs more work on the layering of the server
# structure until complete.
# cppcoreguidelines-pro-type-reinterpret-cast: Qt macros like Q_DECLARE_METATYPE use
# reinterpret_cast.
# cppcoreguidelines-special-member-functions: Pimpl classes in public API need dtors, might be
# possible later on to remove Pimple or the need for dtors and use rule of zero.
# hicpp-signed-bitwise: Qt macros like Q_DECLARE_OPERATORS_FOR_FLAGS conflict.
# hicpp-special-member-functions: See cppcoreguidelines-special-member-functions.
# misc-include-cleaner: For now ignore, as we move to modules later on.
# misc-no-recursion: Qt macros like Q_DECLARE_METATYPE are within recursive call chains.
# performance-no-int-to-ptr: Qt macros like Q_DECLARE_METATYPE fail.
#
Checks: "*,
-altera-struct-pack-align,
-altera-unroll-loops,
-bugprone-easily-swappable-parameters,
-cert-dcl50-cpp,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-type-member-init,
-cppcoreguidelines-pro-type-reinterpret-cast,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-default-arguments-calls,
-fuchsia-default-arguments-declarations,
-fuchsia-overloaded-operator,
-fuchsia-trailing-return,
-google-build-using-namespace,
-google-readability-namespace-comments,
-google-runtime-references,
-hicpp-member-init,
-hicpp-no-array-decay,
-hicpp-signed-bitwise,
-hicpp-special-member-functions,
-hicpp-vararg,
-llvm-header-guard,
-llvm-namespace-comment,
-llvm-qualified-auto,
-llvmlibc-callee-namespace,
-llvmlibc-implementation-in-namespace,
-llvmlibc-inline-function-decl,
-llvmlibc-restrict-system-libc-headers,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-modernize-use-nodiscard,
-modernize-use-trailing-return-type,
-performance-no-int-to-ptr,
-readability-implicit-bool-conversion,
-readability-qualified-auto,
-readability-use-anyofallof
"
CheckOptions:
- key: hicpp-signed-bitwise.IgnorePositiveIntegerLiterals
value: 1
- key: readability-identifier-length.MinimumVariableNameLength
value: 2
- key: readability-identifier-length.MinimumParameterNameLength
value: 2