Suppress clang-tidy warnings in format-inl.h

In non-header-only mode, format.cc includes format-inl.h which defines
a number of functions without the `inline` keyword.
This triggers a clang-tidy warning (misc-definitions-in-headers) about
non-inline functions defined in a header file.
This commit adds a directive to stop clang-tidy 14+ from emitting those
warnings in format-inl.h.
This commit is contained in:
fghzxm 2022-03-27 20:29:27 +08:00
parent e2408f37c8
commit e341175300
No known key found for this signature in database
GPG Key ID: 301CD10D11A1A361

View File

@ -28,6 +28,14 @@
#include "format.h"
// In non-header-only mode, functions in this file are compiled by format.cc
// once and exclusively, so we define functions without `inline`;
// this triggers a clang-tidy warning (misc-definitions-in-headers).
// If the user is using clang-tidy 14+, we can suppress it.
#ifndef FMT_HEADER_ONLY
// NOLINTBEGIN(misc-definitions-in-headers)
#endif
FMT_BEGIN_NAMESPACE
namespace detail {
@ -2590,4 +2598,8 @@ FMT_FUNC auto is_printable(uint32_t cp) -> bool {
FMT_END_NAMESPACE
#ifndef FMT_HEADER_ONLY
// NOLINTEND(misc-definitions-in-headers)
#endif
#endif // FMT_FORMAT_INL_H_