You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently we have enabled lots of clang-tidy checks, but there are so many reports in current kvrocks code, so we cannot treat these report as errors to block future PR with some clang-tidy reported warnings.
/home/runner/work/incubator-kvrocks/incubator-kvrocks/src/cluster/redis_slot.cc:72:29: warning: 'find' called with a string literal consisting of a single character; consider using the more effective overload accepting a character [performance-faster-string-find]
auto right_pos = key.find("}", left_pos + 1);
^~~
'}'
For this report (categorized as performance-faster-string-find), we can replace "}" with '}', and submit a patch. If all performance-faster-string-find tagged report are solved within this patch, we can add performance-faster-string-find to WarningsAsErrors in .clang-tidy. Then, if performance-faster-string-find tagged report appears in a future PR, the CI will fail.
Search before asking
Motivation
Currently we have enabled lots of clang-tidy checks, but there are so many reports in current kvrocks code, so we cannot treat these report as errors to block future PR with some clang-tidy reported warnings.
We can solve these report and enable warning-as-error: https://github.com/apache/incubator-kvrocks/actions/runs/3399280291/jobs/5652921393#step:8:899
For example:
For this report (categorized as
performance-faster-string-find
), we can replace "}" with '}', and submit a patch. If allperformance-faster-string-find
tagged report are solved within this patch, we can addperformance-faster-string-find
toWarningsAsErrors
in.clang-tidy
. Then, ifperformance-faster-string-find
tagged report appears in a future PR, the CI will fail.Solution
Tasks:
cppcoreguidelines-init-variables
warning reported by clang-tidy #1090cppcoreguidelines-macro-usage
warning reported by clang-tidy #1091cppcoreguidelines-narrowing-conversions
warning reported by clang-tidy #1092cppcoreguidelines-special-member-functions
warning reported by clang-tidy #1093modernize-avoid-bind
warning reported by clang-tidy #1094modernize-loop-convert
warning reported by clang-tidy #1095modernize-make-unique
warning reported by clang-tidy #1096modernize-redundant-void-arg
warning reported by clang-tidy #1097modernize-use-auto
warning reported by clang-tidy #1098modernize-use-bool-literals
warning reported by clang-tidy #1099modernize-use-nullptr
warning reported by clang-tidy #1100modernize-use-using
warning reported by clang-tidy #1101performance-faster-string-find
warning reported by clang-tidy #1102performance-for-range-copy
warning reported by clang-tidy #1103performance-inefficient-vector-operation
warning reported by clang-tidy #1104performance-unnecessary-value-param
warning reported by clang-tidy #1105Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: