Commit e0b5cbd4 by Aaron Gokaslan Committed by GitHub

chore(clang-tidy): add more modernize clang-tidy checks (#3049)

* Add more modernize clang-tidy checks

* Enable a few more
parent af6218ff
...@@ -2,12 +2,17 @@ FormatStyle: file ...@@ -2,12 +2,17 @@ FormatStyle: file
Checks: ' Checks: '
llvm-namespace-comment, llvm-namespace-comment,
modernize-use-override, modernize-avoid-bind,
readability-container-size-empty, modernize-replace-auto-ptr,
modernize-use-using, modernize-replace-disallow-copy-and-assign-macro,
modernize-use-equals-default, modernize-shrink-to-fit,
modernize-use-auto, modernize-use-auto,
modernize-use-equals-default,
modernize-use-equals-delete,
modernize-use-emplace, modernize-use-emplace,
modernize-use-override,
modernize-use-using,
readability-container-size-empty,
' '
CheckOptions: CheckOptions:
...@@ -15,3 +20,5 @@ CheckOptions: ...@@ -15,3 +20,5 @@ CheckOptions:
value: 'exception_ptr$;' value: 'exception_ptr$;'
HeaderFilterRegex: 'pybind11/.*h' HeaderFilterRegex: 'pybind11/.*h'
WarningsAsErrors: '*'
...@@ -20,12 +20,12 @@ class TestFactory1 { ...@@ -20,12 +20,12 @@ class TestFactory1 {
TestFactory1() : value("(empty)") { print_default_created(this); } TestFactory1() : value("(empty)") { print_default_created(this); }
TestFactory1(int v) : value(std::to_string(v)) { print_created(this, value); } TestFactory1(int v) : value(std::to_string(v)) { print_created(this, value); }
TestFactory1(std::string v) : value(std::move(v)) { print_created(this, value); } TestFactory1(std::string v) : value(std::move(v)) { print_created(this, value); }
public:
std::string value;
TestFactory1(TestFactory1 &&) = delete; TestFactory1(TestFactory1 &&) = delete;
TestFactory1(const TestFactory1 &) = delete; TestFactory1(const TestFactory1 &) = delete;
TestFactory1 &operator=(TestFactory1 &&) = delete; TestFactory1 &operator=(TestFactory1 &&) = delete;
TestFactory1 &operator=(const TestFactory1 &) = delete; TestFactory1 &operator=(const TestFactory1 &) = delete;
public:
std::string value;
~TestFactory1() { print_destroyed(this); } ~TestFactory1() { print_destroyed(this); }
}; };
// Non-public construction, but moveable: // Non-public construction, but moveable:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment