fix(clang-tidy): clang-tidy readability and misc fixes, like adding const (#3052)

* Enable and apply clang-tidy readability and misc fixes.

* Revert deprecated tester

* add space to tests/test_constants_and_functions.cpp
This commit is contained in:
Aaron Gokaslan
2021-06-21 10:37:48 -04:00
committed by GitHub
parent d00fc62931
commit 3b30b0a51e
16 changed files with 52 additions and 33 deletions

View File

@@ -34,7 +34,7 @@ void noisy_funct_dual(std::string msg, std::string emsg) {
// simply repeatedly write to std::cerr until stopped
// redirect is called at some point to test the safety of scoped_estream_redirect
struct TestThread {
TestThread() : t_{nullptr}, stop_{false} {
TestThread() : stop_{false} {
auto thread_f = [this] {
while (!stop_) {
std::cout << "x" << std::flush;
@@ -49,7 +49,7 @@ struct TestThread {
void stop() { stop_ = true; }
void join() {
void join() const {
py::gil_scoped_release gil_lock;
t_->join();
}
@@ -59,7 +59,7 @@ struct TestThread {
std::this_thread::sleep_for(std::chrono::milliseconds(50));
}
std::thread * t_;
std::thread *t_{nullptr};
std::atomic<bool> stop_;
};