Skip to content

Commit

Permalink
Merge pull request #1521 from hzeller/20221020-fix-some-clang-tidy-co…
Browse files Browse the repository at this point in the history
…mplaints

Fix some clang-tidy complaints.
  • Loading branch information
hzeller authored Oct 20, 2022
2 parents 06e7101 + 4afa5f1 commit 2b787f4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Checks: >
-readability-redundant-access-specifiers,
-readability-use-anyofallof,
-readability-identifier-length,
-readability-uppercase-literal-suffix,
-readability-convert-member-functions-to-static, # creates false positive ?
google-*,
-google-readability-braces-around-statements,
Expand Down
2 changes: 1 addition & 1 deletion common/analysis/lint_waiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void LintWaiver::RegexToLines(absl::string_view contents,
for (const auto* re : rule.second) {
for (std::cregex_iterator i(contents.begin(), contents.end(), *re);
i != std::cregex_iterator(); i++) {
std::cmatch match = *i;
const std::cmatch& match = *i;
WaiveOneLine(rule.first, line_map.LineAtOffset(match.position()));
}
}
Expand Down
6 changes: 3 additions & 3 deletions common/lsp/json-rpc-expect.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ static bool CheckExpectedMatch(const json &expected, const json &received) {
std::cerr << "'json_contains' key missing " << expected << std::endl;
return false;
}
json partial_data = *json_contains;
const json &partial_data = *json_contains;
return CheckNested(partial_data, received);
}

Expand Down Expand Up @@ -149,8 +149,8 @@ int main(int argc, char *argv[]) {
[&expect_data, &expect_pos, &first_error](absl::string_view,
absl::string_view body) {
std::cerr << "Got: " << body << std::endl;
json received = json::parse(body);
json expected = expect_data[expect_pos];
const json received = json::parse(body);
const json &expected = expect_data[expect_pos];
if (!CheckExpectedMatch(expected, received)) {
if (first_error < 0) first_error = expect_pos;
}
Expand Down
4 changes: 2 additions & 2 deletions common/parser/parser_param.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void ParserParam::ResizeStacksInternal(bison_state_int_type** state_stack,
(*size) *= 2;
state_stack_.resize(*size);
value_stack_.resize(*size);
*state_stack = &(state_stack_[0]);
*value_stack = &(value_stack_[0]);
*state_stack = state_stack_.data();
*value_stack = value_stack_.data();
max_used_stack_size_ = *size;
}

Expand Down

0 comments on commit 2b787f4

Please sign in to comment.