Commit graph

18 commits

Author SHA1 Message Date
Dennis Felsing 7903b40066 Quiet clang-tidy on macOS 2022-01-23 19:04:01 +01:00
Dennis Felsing 4da76e0e7d Fix any_of 2022-01-23 18:56:37 +01:00
def ddc279c80f Turn around readability: use all, exclude some 2022-01-23 18:50:11 +01:00
def 94272f82c7 Add more readability checks 2022-01-22 17:45:25 +01:00
def 47518561a8 Consider include directories as SYSTEM dirs
Uses -isystem instead of -I, so that warnings and clang-tidy checks are
ignored for those headers.

No longer need HeaderFilterRegex in clang-tidy since it only checks
non-system headers.
2022-01-22 17:23:46 +01:00
def 3f7befdd8b Add some further readability checks, mostly redundancy
/media/ddnet/src/engine/server/databases/sqlite.cpp:232:55: warning: the address of ‘char* sqlite3_expanded_sql(sqlite3_stmt*)’ will never be NULL [-Waddress]
  232 |         if(m_pStmt != nullptr && sqlite3_expanded_sql != nullptr)
      |                                  ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
2022-01-22 17:22:01 +01:00
def bc78ba57b9 Enable readability-inconsistent-declaration-parameter-name 2022-01-22 14:12:59 +01:00
def 7aac8b5386 Add readability-container-size-empty 2022-01-22 13:54:25 +01:00
def bcb50c1b29 Enable readability-const-return-type, readability-container-data-pointer, readability-delete-null-pointer 2022-01-22 13:49:14 +01:00
def 653c7715a5 Add readability-avoid-const-params-in-decls 2022-01-22 13:44:22 +01:00
def f3796e5455 Disable or fix some spammy new clang-tidy 13 warnings
src/engine/client/backend/opengles/opengles_sl_program.cpp:10:11: warning: suspicious #include of file with '.cpp' extension [bugprone-suspicious-include]
          ^

src/engine/graphics.h:330:67: warning: 2 adjacent parameters of 'CFreeformItem' of similar type ('float') are easily swapped by mistake [bugprone-easily-swappable-parameters]
                CFreeformItem(float x0, float y0, float x1, float y1, float x2, float y2, float x3, float y3) :
                                                                                ^~~~~~~~~~~~~~~~~~

src/game/editor/layer_tiles.cpp:1802:14: warning: result of multiplication in type 'int' is used as a pointer offset after an implicit widening conversion to type 'ptrdiff_t' [bugprone-implicit-widening-of-multiplication-result]
                        mem_zero(&m_pSwitchTile[y * m_Width], o * sizeof(CSwitchTile));
                                  ^

src/game/server/entities/plasma.cpp💯152: warning: operator has equivalent nested operands [misc-redundant-expression]
        if(SnapPlayer && SnapPlayer->GetTeam() != TEAM_SPECTATORS && !SnapPlayer->IsPaused() && SnapChar && SnapChar && SnapChar->Team() != m_ResponsibleTeam && SnapPlayer->m_ShowOthers != 1)
                                                                                                ~~~~~~~~    ~~~~~~~~                                          ^

src/game/editor/editor.cpp:4295:38: warning: The right operand of '>' is a garbage value [clang-analyzer-core.UndefinedBinaryOperatorResult]
                        if(m_FilePreviewImageInfo.m_Width > Preview.w)
                                                          ^ ~~~~~~~~~
2022-01-22 13:35:52 +01:00
def 1ed74af678 Update .clang-tidy file to 11 2020-12-22 12:28:37 +01:00
def 7a9a67c5d7 Enable most clang-tidy misc-* checks 2020-11-05 12:03:14 +01:00
def 312b9d3bd8 Enable clang-tidy performance-* checks 2020-11-05 11:34:20 +01:00
def ba53c7e20c Add most bugprone checks 2020-11-05 08:25:26 +01:00
def b1f0fd8969 Enable modernize-loop-convert clang-tidy check
and run clang-format afterwards

https://clang.llvm.org/extra/clang-tidy/checks/modernize-loop-convert.html
2020-11-02 22:40:24 +01:00
def dad91eb763 Enable readability-qualified-auto clang-tidy check
https://clang.llvm.org/extra/clang-tidy/checks/readability-qualified-auto.html
2020-11-02 22:40:02 +01:00
Edgar baa8b93d2f Add clang-tidy to CI and enable clang-analyzer checks
The actual work will be fixing those or at least
NOLINT(clang-analyzer-optin.cplusplus.VirtualCall) them so we can enable
this. Disable checks that we don't want.

Exclude external directory from clang-tidy.
2020-10-14 14:54:33 +02:00