From e0b5cbd4c6503a96747ca184621e242818fa2ef4 Mon Sep 17 00:00:00 2001 From: Aaron Gokaslan Date: Sat, 19 Jun 2021 18:38:56 -0400 Subject: [PATCH 1/3] chore(clang-tidy): add more modernize clang-tidy checks (#3049) * Add more modernize clang-tidy checks * Enable a few more --- .clang-tidy | 15 +++++++++++---- tests/test_factory_constructors.cpp | 4 ++-- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.clang-tidy b/.clang-tidy index 3079b3b3c..9098e77ff 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -2,12 +2,17 @@ FormatStyle: file Checks: ' llvm-namespace-comment, -modernize-use-override, -readability-container-size-empty, -modernize-use-using, -modernize-use-equals-default, +modernize-avoid-bind, +modernize-replace-auto-ptr, +modernize-replace-disallow-copy-and-assign-macro, +modernize-shrink-to-fit, modernize-use-auto, +modernize-use-equals-default, +modernize-use-equals-delete, modernize-use-emplace, +modernize-use-override, +modernize-use-using, +readability-container-size-empty, ' CheckOptions: @@ -15,3 +20,5 @@ CheckOptions: value: 'exception_ptr$;' HeaderFilterRegex: 'pybind11/.*h' + +WarningsAsErrors: '*' diff --git a/tests/test_factory_constructors.cpp b/tests/test_factory_constructors.cpp index 7ff7e7b52..6832ac494 100644 --- a/tests/test_factory_constructors.cpp +++ b/tests/test_factory_constructors.cpp @@ -20,12 +20,12 @@ class TestFactory1 { TestFactory1() : value("(empty)") { print_default_created(this); } TestFactory1(int v) : value(std::to_string(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(const TestFactory1 &) = delete; TestFactory1 &operator=(TestFactory1 &&) = delete; TestFactory1 &operator=(const TestFactory1 &) = delete; -public: - std::string value; ~TestFactory1() { print_destroyed(this); } }; // Non-public construction, but moveable: From 9b3b35770650832a70c4829b1dcbcd2ab62ae09e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 19 Jun 2021 18:39:54 -0400 Subject: [PATCH 2/3] chore(deps): bump ilammy/msvc-dev-cmd from 1.8.1 to 1.9.0 (#3027) --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ed1da5c5..e00745df7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,7 +151,7 @@ jobs: # MSVC, but for now, this action works: - name: Prepare compiler environment for Windows 🐍 2.7 if: matrix.python == 2.7 && runner.os == 'Windows' - uses: ilammy/msvc-dev-cmd@v1.8.1 + uses: ilammy/msvc-dev-cmd@v1.9.0 with: arch: x64 @@ -741,7 +741,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Prepare MSVC - uses: ilammy/msvc-dev-cmd@v1.8.1 + uses: ilammy/msvc-dev-cmd@v1.9.0 with: arch: x86 @@ -787,7 +787,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.9 - name: Prepare MSVC - uses: ilammy/msvc-dev-cmd@v1.8.1 + uses: ilammy/msvc-dev-cmd@v1.9.0 with: toolset: 14.0 From d00fc62931bde0f2899940f4d487c979a0110422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 20 Jun 2021 00:45:53 +0200 Subject: [PATCH 3/3] use CMAKE_INSTALL_FULL_INCLUDEDIR (#3005) --- tools/pybind11Config.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pybind11Config.cmake.in b/tools/pybind11Config.cmake.in index 0f136005b..6fa03a0f2 100644 --- a/tools/pybind11Config.cmake.in +++ b/tools/pybind11Config.cmake.in @@ -201,7 +201,7 @@ Using ``find_package`` with version info is not recommended except for release v @PACKAGE_INIT@ # Location of pybind11/pybind11.h -set(pybind11_INCLUDE_DIR "${PACKAGE_PREFIX_DIR}/@CMAKE_INSTALL_INCLUDEDIR@") +set(pybind11_INCLUDE_DIR "@CMAKE_INSTALL_FULL_INCLUDEDIR@") set(pybind11_LIBRARY "") set(pybind11_DEFINITIONS USING_pybind11)