Skip to content

Commit 77fa240

Browse files
committed
chore: added clang rules
1 parent 9eef0ca commit 77fa240

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
BasedOnStyle: Google
3+
4+
...

.clang-tidy

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
---
2+
Checks: 'clang-diagnostic-*,clang-analyzer-*,bug-prone-*,-clang-diagnostic-ignored-optimization-argument'
3+
WarningsAsErrors: ''
4+
HeaderFilterRegex: 'src/*.h'
5+
FormatStyle: google
6+
CheckOptions:
7+
- key: llvm-else-after-return.WarnOnConditionVariables
8+
value: 'false'
9+
- key: modernize-loop-convert.MinConfidence
10+
value: reasonable
11+
- key: modernize-replace-auto-ptr.IncludeStyle
12+
value: llvm
13+
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
14+
value: 'false'
15+
- key: google-readability-namespace-comments.ShortNamespaceLines
16+
value: '10'
17+
- key: cert-err33-c.CheckedFunctions
18+
value: '::aligned_alloc;::asctime_s;::at_quick_exit;::atexit;::bsearch;::bsearch_s;::btowc;::c16rtomb;::c32rtomb;::calloc;::clock;::cnd_broadcast;::cnd_init;::cnd_signal;::cnd_timedwait;::cnd_wait;::ctime_s;::fclose;::fflush;::fgetc;::fgetpos;::fgets;::fgetwc;::fopen;::fopen_s;::fprintf;::fprintf_s;::fputc;::fputs;::fputwc;::fputws;::fread;::freopen;::freopen_s;::fscanf;::fscanf_s;::fseek;::fsetpos;::ftell;::fwprintf;::fwprintf_s;::fwrite;::fwscanf;::fwscanf_s;::getc;::getchar;::getenv;::getenv_s;::gets_s;::getwc;::getwchar;::gmtime;::gmtime_s;::localtime;::localtime_s;::malloc;::mbrtoc16;::mbrtoc32;::mbsrtowcs;::mbsrtowcs_s;::mbstowcs;::mbstowcs_s;::memchr;::mktime;::mtx_init;::mtx_lock;::mtx_timedlock;::mtx_trylock;::mtx_unlock;::printf_s;::putc;::putwc;::raise;::realloc;::remove;::rename;::scanf;::scanf_s;::setlocale;::setvbuf;::signal;::snprintf;::snprintf_s;::sprintf;::sprintf_s;::sscanf;::sscanf_s;::strchr;::strerror_s;::strftime;::strpbrk;::strrchr;::strstr;::strtod;::strtof;::strtoimax;::strtok;::strtok_s;::strtol;::strtold;::strtoll;::strtoul;::strtoull;::strtoumax;::strxfrm;::swprintf;::swprintf_s;::swscanf;::swscanf_s;::thrd_create;::thrd_detach;::thrd_join;::thrd_sleep;::time;::timespec_get;::tmpfile;::tmpfile_s;::tmpnam;::tmpnam_s;::tss_create;::tss_get;::tss_set;::ungetc;::ungetwc;::vfprintf;::vfprintf_s;::vfscanf;::vfscanf_s;::vfwprintf;::vfwprintf_s;::vfwscanf;::vfwscanf_s;::vprintf_s;::vscanf;::vscanf_s;::vsnprintf;::vsnprintf_s;::vsprintf;::vsprintf_s;::vsscanf;::vsscanf_s;::vswprintf;::vswprintf_s;::vswscanf;::vswscanf_s;::vwprintf_s;::vwscanf;::vwscanf_s;::wcrtomb;::wcschr;::wcsftime;::wcspbrk;::wcsrchr;::wcsrtombs;::wcsrtombs_s;::wcsstr;::wcstod;::wcstof;::wcstoimax;::wcstok;::wcstok_s;::wcstol;::wcstold;::wcstoll;::wcstombs;::wcstombs_s;::wcstoul;::wcstoull;::wcstoumax;::wcsxfrm;::wctob;::wctrans;::wctype;::wmemchr;::wprintf_s;::wscanf;::wscanf_s;'
19+
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
20+
value: 'false'
21+
- key: cert-dcl16-c.NewSuffixes
22+
value: 'L;LL;LU;LLU'
23+
- key: google-readability-braces-around-statements.ShortStatementLines
24+
value: '1'
25+
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
26+
value: 'true'
27+
- key: google-readability-namespace-comments.SpacesBeforeComments
28+
value: '2'
29+
- key: modernize-loop-convert.MaxCopySize
30+
value: '16'
31+
- key: modernize-pass-by-value.IncludeStyle
32+
value: llvm
33+
- key: modernize-use-nullptr.NullMacros
34+
value: 'NULL'
35+
- key: llvm-qualified-auto.AddConstToQualified
36+
value: 'false'
37+
- key: modernize-loop-convert.NamingStyle
38+
value: CamelCase
39+
- key: llvm-else-after-return.WarnOnUnfixable
40+
value: 'false'
41+
- key: google-readability-function-size.StatementThreshold
42+
value: '800'
43+
...

0 commit comments

Comments
 (0)