Add initial Clang-Tidy configuration files and a CI check
Add an initial Clang-Tidy configuration file which checks for recursion and various clang analyzer issues. Run Clang-Tidy in the "Clang + Code Checks" merge request job. Add NOLINT suppressions where needed in wsutil, epan, and lemon.
This commit is contained in:
parent
9a67fac86f
commit
5f0672d749
|
@ -0,0 +1,20 @@
|
|||
# You can use clang-tidy with CMake by:
|
||||
#
|
||||
# Checking files individually by passing `-DCMAKE_EXPORT_COMPILE_COMMANDS=ON`
|
||||
# to CMake, then running `clang-tidy <file>`
|
||||
#
|
||||
# Checking the entire build by passing `-DCMAKE_C_CLANG_TIDY=clang-tidy`
|
||||
# and `-DCMAKE_CXX_CLANG_TIDY=clang-tidy` to CMake
|
||||
|
||||
ExtraArgs:
|
||||
- '-Wno-unknown-warning-option'
|
||||
|
||||
# Checks to run. A complete list of checks can be found at
|
||||
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
|
||||
Checks:
|
||||
- '-*'
|
||||
- 'misc-no-recursion'
|
||||
|
||||
#WarningsAsErrors: 'misc-no-recursion'
|
||||
|
||||
UseColor: true
|
|
@ -779,7 +779,7 @@ Clang + Code Checks:
|
|||
- cd build
|
||||
- printf "\e[0Ksection_start:%s:cmake_section[collapsed=true]\r\e[0KRunning CMake" "$( date +%s)"
|
||||
# We don't have an "All options" job, so build fuzzshark and tfshark here.
|
||||
- cmake -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_DEBUG=ON -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -G Ninja ..
|
||||
- cmake -DENABLE_CHECKHF_CONFLICT=on -DCMAKE_EXPORT_COMPILE_COMMANDS=on -DCMAKE_C_CLANG_TIDY=clang-tidy-$CLANG_VERSION -DCMAKE_CXX_CLANG_TIDY=clang-tidy-$CLANG_VERSION -DBUILD_fuzzshark=ON -DBUILD_tfshark=On -DBUILD_logray=ON -DENABLE_DEBUG=ON -DENABLE_CCACHE=ON -DENABLE_WERROR=ON -G Ninja ..
|
||||
- printf "\e[0Ksection_end:%s:cmake_section\r\e[0K" "$( date +%s)"
|
||||
- printf "\e[0Ksection_start:%s:asn1_section[collapsed=true]\r\e[0KRegenerating ASN.1 dissectors" "$( date +%s)"
|
||||
- ninja asn1
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include <wsutil/glib-compat.h>
|
||||
#include <wsutil/filter_files.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
static GHashTable *macros_table = NULL;
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
#include "ftypes/ftypes.h"
|
||||
#include <wsutil/ws_assert.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
static void
|
||||
fixup_jumps(void *data, void *user_data);
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
|
||||
#include <ftypes/ftypes.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
#define FAIL(dfw, node, ...) \
|
||||
do { \
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
#include "sttype-function.h"
|
||||
#include "dfilter-int.h"
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
/* Keep track of sttype_t's via their sttype_id_t number */
|
||||
static sttype_t* type_list[STTYPE_NUM_TYPES];
|
||||
|
||||
|
|
|
@ -30,6 +30,8 @@
|
|||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/wslog.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
/* linked list of Lua plugins */
|
||||
typedef struct _wslua_plugin {
|
||||
gchar *name; /**< plugin name */
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
#define ISSPACE(X) isspace((unsigned char)(X))
|
||||
#define ISDIGIT(X) isdigit((unsigned char)(X))
|
||||
#define ISALNUM(X) isalnum((unsigned char)(X))
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
|
||||
#include "path_config.h"
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
#define PROFILES_DIR "profiles"
|
||||
#define PLUGINS_DIR_NAME "plugins"
|
||||
#define EXTCAP_DIR_NAME "extcap"
|
||||
|
|
|
@ -25,6 +25,7 @@
|
|||
#include "wmem_interval_tree.h"
|
||||
#include "wmem_user_cb.h"
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
static void
|
||||
print_range(const void *value)
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
|
||||
#include <wsutil/unicode-utils.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
#define DEFAULT_MINIMUM_SIZE 16
|
||||
|
||||
/* _ROOM accounts for the null-terminator, _RAW_ROOM does not.
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "wmem_tree-int.h"
|
||||
#include "wmem_user_cb.h"
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
static wmem_tree_node_t *
|
||||
node_uncle(wmem_tree_node_t *node)
|
||||
|
|
|
@ -33,6 +33,8 @@
|
|||
#include <wsutil/time_util.h> /* For ws_localtime_r() */
|
||||
#include <wsutil/strtoi.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
#ifdef _WIN32
|
||||
#define tzset _tzset
|
||||
#define tzname _tzname
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include <wsutil/unicode-utils.h>
|
||||
#include <wsutil/wslog.h>
|
||||
|
||||
// NOLINT(misc-no-recursion)
|
||||
|
||||
bool
|
||||
json_validate(const uint8_t *buf, const size_t len)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue