mirror of
https://github.com/tstack/lnav.git
synced 2024-09-21 01:37:15 +03:00
[tidy] some more tidying
This commit is contained in:
parent
99c1688c2e
commit
531c35158c
30
.clang-tidy
30
.clang-tidy
@ -1,18 +1,24 @@
|
||||
---
|
||||
# Enable ALL the things! Except not really
|
||||
# misc-non-private-member-variables-in-classes: the options don't do anything
|
||||
Checks: "*,\
|
||||
-google-readability-todo,\
|
||||
-altera-unroll-loops,\
|
||||
-altera-id-dependent-backward-branch,\
|
||||
-altera-struct-pack-align,\
|
||||
-fuchsia-*,\
|
||||
fuchsia-multiple-inheritance,\
|
||||
-llvm-header-guard,\
|
||||
-llvm-include-order,\
|
||||
-llvmlibc-*,\
|
||||
-modernize-use-trailing-return-type,\
|
||||
-misc-non-private-member-variables-in-classes"
|
||||
Checks: >
|
||||
*,
|
||||
-google-readability-todo,
|
||||
-altera-unroll-loops,
|
||||
-altera-id-dependent-backward-branch,
|
||||
-altera-struct-pack-align,
|
||||
-fuchsia-*,
|
||||
fuchsia-multiple-inheritance,
|
||||
-llvm-header-guard,
|
||||
-llvm-include-order,
|
||||
-llvmlibc-*,
|
||||
-modernize-use-trailing-return-type,
|
||||
-misc-non-private-member-variables-in-classes,
|
||||
-cppcoreguidelines-pro-type-vararg,
|
||||
-hicpp-vararg,
|
||||
-cppcoreguidelines-avoid-c-arrays,
|
||||
-hicpp-avoid-c-arrays,
|
||||
-modernize-avoid-c-arrays
|
||||
WarningsAsErrors: ''
|
||||
CheckOptions:
|
||||
- key: 'bugprone-argument-comment.StrictMode'
|
||||
|
@ -169,7 +169,8 @@ template<typename T>
|
||||
struct string_attr_wrapper {
|
||||
explicit string_attr_wrapper(const string_attr* sa) : saw_string_attr(sa) {}
|
||||
|
||||
const T& get() const
|
||||
template<typename U = T>
|
||||
std::enable_if_t<!std::is_void<U>::value, const U&> get() const
|
||||
{
|
||||
return this->saw_string_attr->sa_value.template get<T>();
|
||||
}
|
||||
|
@ -95,7 +95,7 @@ public:
|
||||
false);
|
||||
};
|
||||
|
||||
std::string to_string(const struct line_range& lr)
|
||||
std::string to_string(const struct line_range& lr) const
|
||||
{
|
||||
const char* start = this->lh_msg_buffer.get_data();
|
||||
|
||||
|
@ -1464,12 +1464,18 @@ logfile_sub_source::eval_sql_filter(sqlite3_stmt* stmt,
|
||||
continue;
|
||||
}
|
||||
if (strcmp(name, ":log_body") == 0) {
|
||||
auto iter = find_string_attr(sa, &SA_BODY);
|
||||
sqlite3_bind_text(stmt,
|
||||
lpc + 1,
|
||||
&(sbr.get_data()[iter->sa_range.lr_start]),
|
||||
iter->sa_range.length(),
|
||||
SQLITE_STATIC);
|
||||
auto body_attr_opt = get_string_attr(sa, SA_BODY);
|
||||
if (body_attr_opt) {
|
||||
auto& sar = body_attr_opt.value().saw_string_attr->sa_range;
|
||||
|
||||
sqlite3_bind_text(stmt,
|
||||
lpc + 1,
|
||||
sbr.get_data_at(sar.lr_start),
|
||||
sar.length(),
|
||||
SQLITE_STATIC);
|
||||
} else {
|
||||
sqlite3_bind_null(stmt, lpc + 1);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (strcmp(name, ":log_raw_text") == 0) {
|
||||
@ -1485,7 +1491,7 @@ logfile_sub_source::eval_sql_filter(sqlite3_stmt* stmt,
|
||||
}
|
||||
continue;
|
||||
}
|
||||
for (auto& lv : values) {
|
||||
for (const auto& lv : values) {
|
||||
if (lv.lv_meta.lvm_name != &name[1]) {
|
||||
continue;
|
||||
}
|
||||
|
@ -43,12 +43,14 @@ static const char* GOOD_TIMES[] = {
|
||||
"05/18/2018 12:00:53 AM",
|
||||
};
|
||||
|
||||
static const char* BAD_TIMES[] = {"1-2-3 1:2:3",
|
||||
static const char* BAD_TIMES[] = {
|
||||
"1-2-3 1:2:3",
|
||||
|
||||
"2013-22-01 12:01:22",
|
||||
"2013-00-01 12:01:22",
|
||||
"2013-22-01 12:01:22",
|
||||
"2013-00-01 12:01:22",
|
||||
|
||||
"@4000000043"};
|
||||
"@4000000043",
|
||||
};
|
||||
|
||||
int
|
||||
main(int argc, char* argv[])
|
||||
|
Loading…
Reference in New Issue
Block a user