Skip to content

Commit f5b285b

Browse files
Merge pull request #739 from jarrodmillman/ruff-format
Ruff format
2 parents 5ce4f87 + 699b86d commit f5b285b

File tree

9 files changed

+17
-21
lines changed

9 files changed

+17
-21
lines changed

.git-blame-ignore-revs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
bb473f6ff4a23e4fd5205eacdef713db15decadf
12
884e2507e482b1ffb471dfa52ee36be8be6f9e35
23
87566f51031ddd54e2f3020bb62d7bf85289e408
34
7cb7b365c51ab20d92745e5eefb95690e3ba2e14

.pre-commit-config.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,6 @@ repos:
2525
files: \.(md|rst|yml|yaml)
2626
args: [--prose-wrap=preserve]
2727

28-
- repo: https://github.com/psf/black
29-
rev: 552baf822992936134cbd31a38f69c8cfe7c0f05 # frozen: 24.3.0
30-
hooks:
31-
- id: black
32-
33-
- repo: https://github.com/adamchainz/blacken-docs
34-
rev: 960ead214cd1184149d366c6d27ca6c369ce46b6 # frozen: 1.16.0
35-
hooks:
36-
- id: blacken-docs
37-
3828
- repo: https://github.com/MarcoGorelli/cython-lint
3929
rev: 582556b052c898dc484a981bea48de3284a4b8ee # frozen: v0.16.0
4030
hooks:
@@ -46,6 +36,7 @@ repos:
4636
hooks:
4737
- id: ruff
4838
args: [--fix, --exit-non-zero-on-fix]
39+
- id: ruff-format
4940

5041
- repo: https://github.com/codespell-project/codespell
5142
rev: "6e41aba91fb32e9feb741a6258eefeb9c6e4a482" # frozen: v2.2.6

advanced/debugging/segfault.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Simple code that creates a segfault using numpy. Used to learn
1+
"""Simple code that creates a segfault using numpy. Used to learn
22
debugging segfaults with GDB.
33
"""
44

advanced/debugging/wiener_filtering.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
""" Wiener filtering a noisy raccoon face: this module is buggy
2-
"""
1+
"""Wiener filtering a noisy raccoon face: this module is buggy"""
32

43
import numpy as np
54
import scipy as sp

advanced/interfacing_with_c/ctypes/cos_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Example of wrapping cos function from math.h using ctypes. """
1+
"""Example of wrapping cos function from math.h using ctypes."""
22

33
import ctypes
44

advanced/interfacing_with_c/ctypes_numpy/cos_doubles.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
""" Example of wrapping a C library function that accepts a C double array as
2-
input using the numpy.ctypeslib. """
1+
"""Example of wrapping a C library function that accepts a C double array as
2+
input using the numpy.ctypeslib."""
33

44
import numpy as np
55
import numpy.ctypeslib as npct

pyximages/numpy_fancy_indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""source code for figure
2-
numpy_fancy_indexing.(png/pdf) used in Sect. 1.3.1.7 Fancy indexing
2+
numpy_fancy_indexing.(png/pdf) used in Sect. 1.3.1.7 Fancy indexing
33
4-
Requirement: PyX>=0.14 (pip installable)
4+
Requirement: PyX>=0.14 (pip installable)
55
66
"""
77

pyximages/numpy_indexing.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""source code for figure
2-
numpy_indexing.(png/pdf) used in Sect. 1.3.1.5 Indexing and slicing
2+
numpy_indexing.(png/pdf) used in Sect. 1.3.1.5 Indexing and slicing
33
4-
Requirement: PyX>=0.14 (pip installable)
4+
Requirement: PyX>=0.14 (pip installable)
55
66
"""
77

ruff.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
target-version = "py310"
2+
3+
[lint]
14
select = [
25
"UP", # pyupgrade
36
"C4", # flake8-comprehensions
47
"E713", # use 'key not in list'
8+
"NPY201", # NumPy 2 compatibility
59
"PIE", # flake8-pie
610
"PGH003", # forbid blanket 'type: ignore' comments
711
"PLR0402", # useless import alias
@@ -12,4 +16,5 @@ select = [
1216
"SIM2", # simplify boolean comparisons
1317
]
1418

15-
target-version = "py310"
19+
[format]
20+
docstring-code-format = true

0 commit comments

Comments
 (0)