Skip to content

Commit e405584

Browse files
committed
Add clang-tidy rules
1 parent 64ea7c4 commit e405584

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.clang-tidy

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
Checks:
2+
'-*,
3+
boost-*,
4+
bugprone-*,
5+
cert-*,
6+
-cert-dcl58-cpp,
7+
clang-analyzer-*,
8+
concurrency-*,
9+
-cppcoreguidelines-*,
10+
-google-*,
11+
hicpp-*,
12+
misc-*,
13+
-misc-const-correctness,
14+
-misc-include-cleaner,
15+
-misc-non-private-member-variables-in-classes,
16+
-modernize-*,
17+
-modernize-use-nodiscard,
18+
performance-*,
19+
portability-*,
20+
-readability-*,
21+
-readability-identifier-*,
22+
-readability-implicit-bool-conversion,
23+
-readability-magic-numbers,
24+
-*-named-parameter,
25+
-*-uppercase-literal-suffix,
26+
-*-use-equals-default,
27+
-*-braces-around-statements
28+
'
29+
HeaderFilterRegex: '.*/execution26/(include|src|example|tests)/.*\.(hpp)$'
30+
WarningsAsErrors: 'clang*'
31+
FormatStyle: file
32+
33+
CheckOptions:
34+
- { key: readability-identifier-naming.NamespaceCase, value: CamelCase }
35+
- { key: readability-identifier-naming.ClassCase, value: CamelCase }
36+
- { key: readability-identifier-naming.EnumCase, value: CamelCase }
37+
- { key: readability-identifier-naming.MemberCase, value: camelBack }
38+
- { key: readability-identifier-naming.MemberPrefix, value: m_ }
39+
- { key: readability-identifier-naming.StructCase, value: lower_case }
40+
- { key: readability-identifier-naming.UnionCase, value: lower_case }
41+
- { key: readability-identifier-naming.TypedefCase, value: lower_case }
42+
- { key: readability-identifier-naming.TypedefSuffix, value: _type }
43+
- { key: readability-identifier-naming.FunctionCase, value: camelBack }
44+
- { key: readability-identifier-naming.VariableCase, value: camelBack }
45+
- { key: readability-identifier-naming.ParameterCase, value: camelBack }
46+
- { key: readability-identifier-naming.LocalVariableCase, value: camelBack }
47+
- { key: readability-identifier-naming.ConstexprFunctionCase, value: camelBack }
48+
- { key: readability-identifier-naming.ConstexprMethodCase, value: camelBack }
49+
- { key: readability-identifier-naming.ConstexprVariableCase, value: UPPER_CASE }
50+
- { key: readability-identifier-naming.ClassConstantCase, value: UPPER_CASE }
51+
- { key: readability-identifier-naming.EnumConstantCase, value: UPPER_CASE }
52+
- { key: readability-identifier-naming.GlobalConstantCase, value: UPPER_CASE }
53+
- { key: readability-identifier-naming.GlobalConstantPointerCase, value: UPPER_CASE }
54+
- { key: readability-identifier-naming.LocalConstantPointerCase, value: UPPER_CASE }
55+
- { key: readability-identifier-naming.ScopedEnumConstantCase, value: UPPER_CASE }
56+
- { key: readability-identifier-naming.StaticConstantCase, value: UPPER_CASE }

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
SANITIZERS = release debug msan asan usan tsan
55

6-
.PHONY: default doc run update check ce todo distclean clean codespell build test all format $(SANITIZERS)
6+
.PHONY: default doc run update check ce todo distclean clean codespell clang-tidy build test all format $(SANITIZERS)
77

88
COMPILER=system
99
CXX_BASE=$(CXX:$(dir $(CXX))%=%)
@@ -83,6 +83,8 @@ check:
8383
< $$h sed -n "/^ *# *include <Beman\//s@.*[</]Beman/\(.*\).hpp>.*@$$from \1@p"; \
8484
done | tsort > /dev/null
8585

86+
clang-tidy:
87+
clang-tidy-17 -p build/debug tests/beman/execution26/exec-just.test.cpp
8688

8789
codespell:
8890
codespell -L statics,snd,copyable,cancelled

0 commit comments

Comments
 (0)