Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
3aece819
Unverified
Commit
3aece819
authored
Oct 27, 2023
by
Henry Schreiner
Committed by
GitHub
Oct 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: update hooks and Ruff config (#4904)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
parent
1e28599e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
18 deletions
+18
-18
.pre-commit-config.yaml
+7
-7
pyproject.toml
+8
-8
tests/test_numpy_dtypes.cpp
+1
-1
tests/test_pytypes.cpp
+2
-2
No files found.
.pre-commit-config.yaml
View file @
3aece819
...
...
@@ -25,27 +25,27 @@ repos:
# Clang format the codebase automatically
-
repo
:
https://github.com/pre-commit/mirrors-clang-format
rev
:
"
v1
6.0.6
"
rev
:
"
v1
7.0.3
"
hooks
:
-
id
:
clang-format
types_or
:
[
c++
,
c
,
cuda
]
# Black, the code formatter, natively supports pre-commit
-
repo
:
https://github.com/psf/black-pre-commit-mirror
rev
:
"
23.
9
.1"
# Keep in sync with blacken-docs
rev
:
"
23.
10
.1"
# Keep in sync with blacken-docs
hooks
:
-
id
:
black
# Ruff, the Python auto-correcting linter written in Rust
-
repo
:
https://github.com/astral-sh/ruff-pre-commit
rev
:
v0.
0.29
2
rev
:
v0.
1.
2
hooks
:
-
id
:
ruff
args
:
[
"
--fix"
,
"
--show-fixes"
]
# Check static types with mypy
-
repo
:
https://github.com/pre-commit/mirrors-mypy
rev
:
"
v1.
5
.1"
rev
:
"
v1.
6
.1"
hooks
:
-
id
:
mypy
args
:
[]
...
...
@@ -67,7 +67,7 @@ repos:
# Standard hooks
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
"
v4.
4
.0"
rev
:
"
v4.
5
.0"
hooks
:
-
id
:
check-added-large-files
-
id
:
check-case-conflict
...
...
@@ -98,7 +98,7 @@ repos:
# Avoid directional quotes
-
repo
:
https://github.com/sirosen/texthooks
rev
:
"
0.
5.0
"
rev
:
"
0.
6.2
"
hooks
:
-
id
:
fix-ligatures
-
id
:
fix-smartquotes
...
...
@@ -147,7 +147,7 @@ repos:
# PyLint has native support - not always usable, but works for us
-
repo
:
https://github.com/PyCQA/pylint
rev
:
"
v3.0.
0
"
rev
:
"
v3.0.
1
"
hooks
:
-
id
:
pylint
files
:
^pybind11
pyproject.toml
View file @
3aece819
...
...
@@ -19,7 +19,7 @@ ignore = [
[tool.mypy]
files
=
["pybind11"]
python_version
=
"3.
6
"
python_version
=
"3.
7
"
strict
=
true
show_error_codes
=
true
enable_error_code
=
[
"ignore-without-code"
,
"redundant-expr"
,
"truthy-bool"
]
...
...
@@ -57,10 +57,13 @@ messages_control.disable = [
"unused-argument"
,
# covered by Ruff ARG
]
[tool.ruff]
select
=
[
"E"
,
"F"
,
"W"
,
# flake8
target-version
=
"py37"
src
=
["src"]
line-length
=
120
[tool.ruff.lint]
extend-select
=
[
"B"
,
# flake8-bugbear
"I"
,
# isort
"N"
,
# pep8-naming
...
...
@@ -86,13 +89,10 @@ ignore = [
"PT004"
,
# Fixture that doesn't return needs underscore (no, it is fine)
"SIM118"
,
# iter(x) is not always the same as iter(x.keys())
]
target-version
=
"py37"
src
=
["src"]
unfixable
=
["T20"]
exclude
=
[]
line-length
=
120
isort.known-first-party
=
[
"env"
,
"pybind11_cross_module_tests"
,
"pybind11_tests"
]
[tool.ruff.per-file-ignores]
[tool.ruff.
lint.
per-file-ignores]
"tests/**"
=
[
"EM"
,
"N"
,
"E721"
]
"tests/test_call_policies.py"
=
["PLC1901"]
tests/test_numpy_dtypes.cpp
View file @
3aece819
...
...
@@ -157,7 +157,7 @@ py::array mkarray_via_buffer(size_t n) {
do { \
(s).bool_ = (i) % 2 != 0; \
(s).uint_ = (uint32_t) (i); \
(s).float_ = (float) (i) *
1.5f;
\
(s).float_ = (float) (i) *
1.5f;
\
(s).ldbl_ = (long double) (i) * -2.5L; \
} while (0)
...
...
tests/test_pytypes.cpp
View file @
3aece819
...
...
@@ -662,8 +662,8 @@ TEST_SUBMODULE(pytypes, m) {
// This is "most correct" and enforced on these platforms.
# define PYBIND11_AUTO_IT auto it
#else
// This works on many platforms and is (unfortunately) reflective of existing user code.
// NOLINTNEXTLINE(bugprone-macro-parentheses)
// This works on many platforms and is (unfortunately) reflective of existing user code.
// NOLINTNEXTLINE(bugprone-macro-parentheses)
# define PYBIND11_AUTO_IT auto &it
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment