Skip to content

Commit 37f845a

Browse files
authored
ci: disallow some common capitalization mistakes (#2472)
* ci: only annotate linux for now * style: block some common mistakes
1 parent 064a03a commit 37f845a

File tree

7 files changed

+16
-6
lines changed

7 files changed

+16
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ on:
1212
jobs:
1313
standard:
1414
strategy:
15+
fail-fast: false
1516
matrix:
1617
runs-on: [ubuntu-latest, windows-latest, macos-latest]
1718
arch: [x64]
@@ -103,6 +104,7 @@ jobs:
103104
run: python -m pip install -r tests/requirements.txt --prefer-binary
104105

105106
- name: Setup annotations
107+
if: runner.os == 'Linux'
106108
run: python -m pip install pytest-github-actions-annotate-failures
107109

108110
- name: Configure C++11 ${{ matrix.args }}

.pre-commit-config.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ repos:
3434
types: [file]
3535
files: (\.cmake|CMakeLists.txt)(.in)?$
3636

37+
- repo: local
38+
hooks:
39+
- id: disallow-caps
40+
name: Disallow improper capitalization
41+
language: pygrep
42+
entry: PyBind|Numpy|Cmake
43+
exclude: .pre-commit-config.yaml
44+
3745
- repo: local
3846
hooks:
3947
- id: check-style

docs/advanced/cast/eigen.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ Vectors versus column/row matrices
274274

275275
Eigen and numpy have fundamentally different notions of a vector. In Eigen, a
276276
vector is simply a matrix with the number of columns or rows set to 1 at
277-
compile time (for a column vector or row vector, respectively). Numpy, in
277+
compile time (for a column vector or row vector, respectively). NumPy, in
278278
contrast, has comparable 2-dimensional 1xN and Nx1 arrays, but *also* has
279279
1-dimensional arrays of size N.
280280

docs/changelog.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ v2.2.0 (August 31, 2017)
628628
in reference cycles.
629629
`#856 <https://github.com/pybind/pybind11/pull/856>`_.
630630

631-
* Numpy and buffer protocol related improvements:
631+
* NumPy and buffer protocol related improvements:
632632

633633
1. Support for negative strides in Python buffer objects/numpy arrays. This
634634
required changing integers from unsigned to signed for the related C++ APIs.
@@ -1359,7 +1359,7 @@ Happy Christmas!
13591359
* Improved support for ``std::shared_ptr<>`` conversions
13601360
* Initial support for ``std::set<>`` conversions
13611361
* Fixed type resolution issue for types defined in a separate plugin module
1362-
* Cmake build system improvements
1362+
* CMake build system improvements
13631363
* Factored out generic functionality to non-templated code (smaller code size)
13641364
* Added a code size / compile time benchmark vs Boost.Python
13651365
* Added an appveyor CI script

docs/faq.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ CMake code. Conflicts can arise, however, when using pybind11 in a project that
285285
Python detection in a system with several Python versions installed.
286286

287287
This difference may cause inconsistencies and errors if *both* mechanisms are used in the same project. Consider the following
288-
Cmake code executed in a system with Python 2.7 and 3.x installed:
288+
CMake code executed in a system with Python 2.7 and 3.x installed:
289289

290290
.. code-block:: cmake
291291

docs/upgrade.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ something. The changes are:
3232
``CMAKE_CXX_STANDARD=<number>`` instead, or any other valid CMake CXX or CUDA
3333
standard selection method, like ``target_compile_features``.
3434

35-
* If you do not request a standard, PyBind11 targets will compile with the
35+
* If you do not request a standard, pybind11 targets will compile with the
3636
compiler default, but not less than C++11, instead of forcing C++14 always.
3737
If you depend on the old behavior, please use ``set(CMAKE_CXX_STANDARD 14)``
3838
instead.

tests/test_numpy_vectorize.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ TEST_SUBMODULE(numpy_vectorize, m) {
3737
));
3838

3939
// test_type_selection
40-
// Numpy function which only accepts specific data types
40+
// NumPy function which only accepts specific data types
4141
m.def("selective_func", [](py::array_t<int, py::array::c_style>) { return "Int branch taken."; });
4242
m.def("selective_func", [](py::array_t<float, py::array::c_style>) { return "Float branch taken."; });
4343
m.def("selective_func", [](py::array_t<std::complex<float>, py::array::c_style>) { return "Complex float branch taken."; });

0 commit comments

Comments
 (0)