Skip to content

Commit

Permalink
Setup clang-tidy in CI, and organize imports (#25)
Browse files Browse the repository at this point in the history
This PR also fixed a few bugs as noted by clang-tidy.
  • Loading branch information
smarr authored Jul 19, 2024
2 parents f3a9d3b + 5970335 commit 5d54adb
Show file tree
Hide file tree
Showing 106 changed files with 872 additions and 1,919 deletions.
67 changes: 67 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
Checks: '*include*,
-altera-unroll-loops,
-altera-id-dependent-backward-branch,
-cppcoreguidelines-avoid-do-while,
-llvm-header-guard,
-llvmlibc-*,
-modernize-use-trailing-return-type,
-readability-function-cognitive-complexity,
'
# '*,
# '
# -bugprone-easily-swappable-parameters,
# -bugprone-exception-escape,
# -concurrency-mt-unsafe,
# -cppcoreguidelines-avoid-const-or-ref-data-members,
# -cppcoreguidelines-avoid-magic-numbers,
# -cppcoreguidelines-avoid-non-const-global-variables
# -cppcoreguidelines-non-private-member-variables-in-classes,
# -cppcoreguidelines-pro-bounds-constant-array-index,
# -fuchsia-default-arguments-calls,
# -fuchsia-default-arguments-declarations,
# -fuchsia-statically-constructed-objects,
# -fuchsia-virtual-inheritance,
# -google-global-names-in-headers,
# -hicpp-named-parameter,
# -hicpp-use-auto,
# -llvm-include-order,
# -llvmlibc-*,
# -misc-no-recursion,
# -misc-non-private-member-variables-in-classes,
# -misc-use-anonymous-namespace,
# -readability-delete-null-pointer,
# -readability-convert-member-functions-to-static,
# -readability-identifier-length,
# -readability-magic-numbers,
# -readability-named-parameter,
# -readability-simplify-boolean-expr,
# -cppcoreguidelines-special-member-functions,
# -hicpp-special-member-functions,
# -cppcoreguidelines-pro-bounds-pointer-arithmetic,
# -cppcoreguidelines-owning-memory,
WarningsAsErrors: ''
HeaderFilterRegex: '^(?!.*cppunit).*$'
# AnalyzeTemporaryDtors: false
FormatStyle: none
User: smarr
CheckOptions:
cert-dcl16-c.NewSuffixes: 'L;LL;LU;LLU'
cert-err33-c.CheckedFunctions: '::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;'
cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField: 'false'
cert-str34-c.DiagnoseSignedUnsignedCharComparisons: 'false'
cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic: 'true'
google-readability-braces-around-statements.ShortStatementLines: '1'
google-readability-function-size.StatementThreshold: '800'
google-readability-namespace-comments.ShortNamespaceLines: '10'
google-readability-namespace-comments.SpacesBeforeComments: '2'
llvm-else-after-return.WarnOnConditionVariables: 'false'
llvm-else-after-return.WarnOnUnfixable: 'false'
llvm-qualified-auto.AddConstToQualified: 'false'
modernize-loop-convert.MaxCopySize: '16'
modernize-loop-convert.MinConfidence: reasonable
modernize-loop-convert.NamingStyle: CamelCase
modernize-pass-by-value.IncludeStyle: llvm
modernize-replace-auto-ptr.IncludeStyle: llvm
modernize-use-nullptr.NullMacros: 'NULL'
...
Loading

0 comments on commit 5d54adb

Please sign in to comment.