Skip to content

Commit

Permalink
enable two new clang-tidy checks (#3988)
Browse files Browse the repository at this point in the history
* enable two new clang-tidy checks

* Use better loop var for char
  • Loading branch information
Skylion007 committed Jun 6, 2022
1 parent 42a41bf commit 554c045
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
google-explicit-constructor,
llvm-namespace-comment,
misc-definitions-in-headers,
misc-misplaced-const,
misc-non-copyable-objects,
misc-static-assert,
misc-throw-by-value-catch-by-reference,
misc-uniqueptr-reset-release,
misc-unused-parameters,
modernize-avoid-bind,
modernize-loop-convert,
modernize-make-shared,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
Expand Down Expand Up @@ -63,6 +65,8 @@ readability-uniqueptr-delete-release,
CheckOptions:
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: true
- key: performance-inefficient-string-concatenation.StrictMode
value: true
- key: performance-unnecessary-value-param.AllowedTypes
value: 'exception_ptr$;'
- key: readability-implicit-bool-conversion.AllowPointerConditions
Expand Down
4 changes: 2 additions & 2 deletions tests/test_constants_and_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ py::bytes return_bytes() {
std::string print_bytes(const py::bytes &bytes) {
std::string ret = "bytes[";
const auto value = static_cast<std::string>(bytes);
for (size_t i = 0; i < value.length(); ++i) {
ret += std::to_string(static_cast<int>(value[i])) + " ";
for (char c : value) {
ret += std::to_string(static_cast<int>(c)) + ' ';
}
ret.back() = ']';
return ret;
Expand Down

0 comments on commit 554c045

Please sign in to comment.