Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
554c0453
Unverified
Commit
554c0453
authored
Jun 06, 2022
by
Aaron Gokaslan
Committed by
GitHub
Jun 06, 2022
Browse files
enable two new clang-tidy checks (#3988)
* enable two new clang-tidy checks * Use better loop var for char
parent
42a41bf3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
.clang-tidy
.clang-tidy
+4
-0
tests/test_constants_and_functions.cpp
tests/test_constants_and_functions.cpp
+2
-2
No files found.
.clang-tidy
View file @
554c0453
...
@@ -10,6 +10,7 @@ cppcoreguidelines-pro-type-static-cast-downcast,
...
@@ -10,6 +10,7 @@ cppcoreguidelines-pro-type-static-cast-downcast,
cppcoreguidelines-slicing,
cppcoreguidelines-slicing,
google-explicit-constructor,
google-explicit-constructor,
llvm-namespace-comment,
llvm-namespace-comment,
misc-definitions-in-headers,
misc-misplaced-const,
misc-misplaced-const,
misc-non-copyable-objects,
misc-non-copyable-objects,
misc-static-assert,
misc-static-assert,
...
@@ -17,6 +18,7 @@ misc-throw-by-value-catch-by-reference,
...
@@ -17,6 +18,7 @@ misc-throw-by-value-catch-by-reference,
misc-uniqueptr-reset-release,
misc-uniqueptr-reset-release,
misc-unused-parameters,
misc-unused-parameters,
modernize-avoid-bind,
modernize-avoid-bind,
modernize-loop-convert,
modernize-make-shared,
modernize-make-shared,
modernize-redundant-void-arg,
modernize-redundant-void-arg,
modernize-replace-auto-ptr,
modernize-replace-auto-ptr,
...
@@ -63,6 +65,8 @@ readability-uniqueptr-delete-release,
...
@@ -63,6 +65,8 @@ readability-uniqueptr-delete-release,
CheckOptions:
CheckOptions:
- key: performance-for-range-copy.WarnOnAllAutoCopies
- key: performance-for-range-copy.WarnOnAllAutoCopies
value: true
value: true
- key: performance-inefficient-string-concatenation.StrictMode
value: true
- key: performance-unnecessary-value-param.AllowedTypes
- key: performance-unnecessary-value-param.AllowedTypes
value: 'exception_ptr$;'
value: 'exception_ptr$;'
- key: readability-implicit-bool-conversion.AllowPointerConditions
- key: readability-implicit-bool-conversion.AllowPointerConditions
...
...
tests/test_constants_and_functions.cpp
View file @
554c0453
...
@@ -31,8 +31,8 @@ py::bytes return_bytes() {
...
@@ -31,8 +31,8 @@ py::bytes return_bytes() {
std
::
string
print_bytes
(
const
py
::
bytes
&
bytes
)
{
std
::
string
print_bytes
(
const
py
::
bytes
&
bytes
)
{
std
::
string
ret
=
"bytes["
;
std
::
string
ret
=
"bytes["
;
const
auto
value
=
static_cast
<
std
::
string
>
(
bytes
);
const
auto
value
=
static_cast
<
std
::
string
>
(
bytes
);
for
(
size_t
i
=
0
;
i
<
value
.
length
();
++
i
)
{
for
(
char
c
:
value
)
{
ret
+=
std
::
to_string
(
static_cast
<
int
>
(
value
[
i
]
))
+
" "
;
ret
+=
std
::
to_string
(
static_cast
<
int
>
(
c
))
+
' '
;
}
}
ret
.
back
()
=
']'
;
ret
.
back
()
=
']'
;
return
ret
;
return
ret
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment