From 0b4c1bc2865cf89abc751809e72a184bde671678 Mon Sep 17 00:00:00 2001 From: Axel Huebl Date: Mon, 29 Aug 2022 20:25:01 -0700 Subject: [PATCH 1/3] test: ConstructorStats newline (PyPy) (#4167) This looks like it lacks a newline. --- tests/constructor_stats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/constructor_stats.h b/tests/constructor_stats.h index a3835c21e..937f6c233 100644 --- a/tests/constructor_stats.h +++ b/tests/constructor_stats.h @@ -115,7 +115,7 @@ public: #if defined(PYPY_VERSION) PyObject *globals = PyEval_GetGlobals(); PyObject *result = PyRun_String("import gc\n" - "for i in range(2):" + "for i in range(2):\n" " gc.collect()\n", Py_file_input, globals, From 283f10dc55636e495bc2114c6b5baf7cd7064a0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 23:26:53 -0400 Subject: [PATCH 2/3] chore(deps): bump ilammy/msvc-dev-cmd from 1.10.0 to 1.11.0 (#4161) Bumps [ilammy/msvc-dev-cmd](https://github.com/ilammy/msvc-dev-cmd) from 1.10.0 to 1.11.0. - [Release notes](https://github.com/ilammy/msvc-dev-cmd/releases) - [Commits](https://github.com/ilammy/msvc-dev-cmd/compare/v1.10.0...v1.11.0) --- updated-dependencies: - dependency-name: ilammy/msvc-dev-cmd dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ac6c536ce..213c69005 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -754,7 +754,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.12 - name: Prepare MSVC - uses: ilammy/msvc-dev-cmd@v1.10.0 + uses: ilammy/msvc-dev-cmd@v1.11.0 with: arch: x86 @@ -807,7 +807,7 @@ jobs: uses: jwlawson/actions-setup-cmake@v1.12 - name: Prepare MSVC - uses: ilammy/msvc-dev-cmd@v1.10.0 + uses: ilammy/msvc-dev-cmd@v1.11.0 with: arch: x86 From 8756f16ed842e40406018df901f3219b231e2105 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 21:59:48 -0700 Subject: [PATCH 3/3] [pre-commit.ci] pre-commit autoupdate (#4151) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [pre-commit.ci] pre-commit autoupdate updates: - [github.com/Lucas-C/pre-commit-hooks: v1.3.0 → v1.3.1](https://github.com/Lucas-C/pre-commit-hooks/compare/v1.3.0...v1.3.1) - [github.com/sirosen/texthooks: 0.3.1 → 0.4.0](https://github.com/sirosen/texthooks/compare/0.3.1...0.4.0) - [github.com/PyCQA/pylint: v2.14.5 → v2.15.0](https://github.com/PyCQA/pylint/compare/v2.14.5...v2.15.0) - [github.com/codespell-project/codespell: v2.1.0 → v2.2.1](https://github.com/codespell-project/codespell/compare/v2.1.0...v2.2.1) * Introduce .codespell-ignore-lines for safer (line-based instead of word-based) suppressions. * Fix two issues: 1. ensure sort order; 2. remove duplicates Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Ralf W. Grosse-Kunstleve --- .codespell-ignore-lines | 24 ++++++++++++++ .pre-commit-config.yaml | 12 ++++--- tools/codespell_ignore_lines_from_errors.py | 35 +++++++++++++++++++++ 3 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 .codespell-ignore-lines create mode 100644 tools/codespell_ignore_lines_from_errors.py diff --git a/.codespell-ignore-lines b/.codespell-ignore-lines new file mode 100644 index 000000000..2a01d63eb --- /dev/null +++ b/.codespell-ignore-lines @@ -0,0 +1,24 @@ +template + template + auto &this_ = static_cast(*this); + if (load_impl(temp, false)) { + ssize_t nd = 0; + auto trivial = broadcast(buffers, nd, shape); + auto ndim = (size_t) nd; + int nd; + ssize_t ndim() const { return detail::array_proxy(m_ptr)->nd; } + using op = op_impl; +template + template + class_ &def(const detail::op_ &op, const Extra &...extra) { + class_ &def_cast(const detail::op_ &op, const Extra &...extra) { +@pytest.mark.parametrize("access", ["ro", "rw", "static_ro", "static_rw"]) +struct IntStruct { + explicit IntStruct(int v) : value(v){}; + ~IntStruct() { value = -value; } + IntStruct(const IntStruct &) = default; + IntStruct &operator=(const IntStruct &) = default; + py::class_(m, "IntStruct").def(py::init([](const int i) { return IntStruct(i); })); + py::implicitly_convertible(); + m.def("test", [](int expected, const IntStruct &in) { + [](int expected, const IntStruct &in) { diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a962f8b79..bced50caf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -62,12 +62,12 @@ repos: # Changes tabs to spaces - repo: https://github.com/Lucas-C/pre-commit-hooks - rev: "v1.3.0" + rev: "v1.3.1" hooks: - id: remove-tabs - repo: https://github.com/sirosen/texthooks - rev: "0.3.1" + rev: "0.4.0" hooks: - id: fix-ligatures - id: fix-smartquotes @@ -110,7 +110,7 @@ repos: # PyLint has native support - not always usable, but works for us - repo: https://github.com/PyCQA/pylint - rev: "v2.14.5" + rev: "v2.15.0" hooks: - id: pylint files: ^pybind11 @@ -143,12 +143,14 @@ repos: additional_dependencies: [cmake, ninja] # Check for spelling +# Use tools/codespell_ignore_lines_from_errors.py +# to rebuild .codespell-ignore-lines - repo: https://github.com/codespell-project/codespell - rev: "v2.1.0" + rev: "v2.2.1" hooks: - id: codespell exclude: ".supp$" - args: ["-L", "nd,ot,thist"] + args: ["-x", ".codespell-ignore-lines"] # Check for common shell mistakes - repo: https://github.com/shellcheck-py/shellcheck-py diff --git a/tools/codespell_ignore_lines_from_errors.py b/tools/codespell_ignore_lines_from_errors.py new file mode 100644 index 000000000..5403ec3ad --- /dev/null +++ b/tools/codespell_ignore_lines_from_errors.py @@ -0,0 +1,35 @@ +"""Simple script for rebuilding .codespell-ignore-lines + +Usage: + +cat < /dev/null > .codespell-ignore-lines +pre-commit run --all-files codespell >& /tmp/codespell_errors.txt +python3 tools/codespell_ignore_lines_from_errors.py /tmp/codespell_errors.txt > .codespell-ignore-lines + +git diff to review changes, then commit, push. +""" + +import sys +from typing import List + + +def run(args: List[str]) -> None: + assert len(args) == 1, "codespell_errors.txt" + cache = {} + done = set() + for line in sorted(open(args[0]).read().splitlines()): + i = line.find(" ==> ") + if i > 0: + flds = line[:i].split(":") + if len(flds) >= 2: + filename, line_num = flds[:2] + if filename not in cache: + cache[filename] = open(filename).read().splitlines() + supp = cache[filename][int(line_num) - 1] + if supp not in done: + print(supp) + done.add(supp) + + +if __name__ == "__main__": + run(args=sys.argv[1:])