Skip to content

Commit 01c36f9

Browse files
committed
update pre-commit
1 parent 07a5a6d commit 01c36f9

17 files changed

+44
-50
lines changed

.pre-commit-config.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ exclude: |
2020
repos:
2121
# Standard hooks
2222
- repo: https://github.com/pre-commit/pre-commit-hooks
23-
rev: "v4.5.0"
23+
rev: "v5.0.0"
2424
hooks:
2525
- id: check-added-large-files
2626
- id: check-case-conflict
@@ -37,13 +37,13 @@ repos:
3737

3838
# Black, the code formatter, natively supports pre-commit
3939
- repo: https://github.com/psf/black-pre-commit-mirror
40-
rev: "24.2.0" # Keep in sync with blacken-docs
40+
rev: "25.1.0" # Keep in sync with blacken-docs
4141
hooks:
4242
- id: black
4343

4444
# Also code format the docs
4545
- repo: https://github.com/asottile/blacken-docs
46-
rev: "1.16.0"
46+
rev: "1.19.1"
4747
hooks:
4848
- id: blacken-docs
4949
additional_dependencies:
@@ -56,7 +56,7 @@ repos:
5656
- id: remove-tabs
5757

5858
- repo: https://github.com/sirosen/texthooks
59-
rev: "0.6.4"
59+
rev: "0.6.8"
6060
hooks:
6161
- id: fix-ligatures
6262
- id: fix-smartquotes
@@ -73,7 +73,7 @@ repos:
7373

7474
# PyLint has native support - not always usable, but works for us
7575
- repo: https://github.com/PyCQA/pylint
76-
rev: "v3.1.0"
76+
rev: "v3.3.6"
7777
hooks:
7878
- id: pylint
7979
files: ^pybind11
@@ -98,30 +98,30 @@ repos:
9898

9999
# Checks the manifest for missing files (native support)
100100
- repo: https://github.com/mgedmin/check-manifest
101-
rev: "0.49"
101+
rev: "0.50"
102102
hooks:
103103
- id: check-manifest
104104
# This is a slow hook, so only run this if --hook-stage manual is passed
105105
stages: [manual]
106106
additional_dependencies: [cmake, ninja]
107107

108108
- repo: https://github.com/charliermarsh/ruff-pre-commit
109-
rev: v0.3.0
109+
rev: v0.11.5
110110
hooks:
111111
- id: ruff
112112
args: ["--fix", "--show-fixes"]
113113

114114
# Check for spelling
115115
- repo: https://github.com/codespell-project/codespell
116-
rev: "v2.2.6"
116+
rev: "v2.4.1"
117117
hooks:
118118
- id: codespell
119119
exclude: ".*/test_.*.py"
120120
args: ["-x", ".codespell-ignore-lines"]
121121

122122
# Check for common shell mistakes
123123
- repo: https://github.com/shellcheck-py/shellcheck-py
124-
rev: "v0.9.0.6"
124+
rev: "v0.10.0.1"
125125
hooks:
126126
- id: shellcheck
127127

@@ -136,7 +136,7 @@ repos:
136136

137137
# Clang format the codebase automatically
138138
- repo: https://github.com/pre-commit/mirrors-clang-format
139-
rev: "v17.0.6"
139+
rev: "v20.1.0"
140140
hooks:
141141
- id: clang-format
142142
types_or: [c++, c]

api_differences.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ that it does not provide the optional argument `force_ascii` which removes any n
4444
- `fuzz.UWRatio`
4545
- `fuzz.UQRatio`
4646

47-
With the exception `fuzz.UWRatio` and `fuzz.UQRatio` of all have `force_ascii` enabled forthe peprocessing function by default.
47+
With the exception `fuzz.UWRatio` and `fuzz.UQRatio` of all have `force_ascii` enabled for the peprocessing function by default.
4848

4949
In `RapidFuzz` no scorer preprocesses strings by default to keep the interface consistent. However a preprocessing function can be provided using the `processor` argument. In addition the functions `fuzz.UWRatio` and `fuzz.UQRatio` do not exist, since they are the same as `fuzz.WRatio` / `fuzz.QRatio` with `force_ascii` disabled. Since in `RapidFuzz` the `force_ascii` argument does not exist these functions do not provide any value.
5050

bench/benchmark_cdist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def benchmark():
6565
print("System:", get_platform())
6666
print("Words :", len(words))
6767
print("Sample:", len(sample))
68-
print("Total : %s calls\n" % total)
68+
print(f"Total : {total} calls\n")
6969

7070
def wrap_cdist(scorer, processor):
7171
from rapidfuzz.process import cdist

bench/benchmark_cpdist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def benchmark():
5555
print("System:", get_platform())
5656
print("Words :", len(words1))
5757
print("Sample:", len(words2))
58-
print("Total : %s calls\n" % total)
58+
print(f"Total : {total} calls\n")
5959

6060
def wrap_cpdist(scorer):
6161
from rapidfuzz.process import cpdist

bench/benchmark_scorer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def benchmark():
5555
print("System:", get_platform())
5656
print("Words :", len(words))
5757
print("Sample:", len(sample))
58-
print("Total : %s calls\n" % total)
58+
print(f"Total : {total} calls\n")
5959

6060
def wrap(f):
6161
def func():

src/rapidfuzz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
from rapidfuzz import distance, fuzz, process, utils
1212

13-
__all__ = ["distance", "fuzz", "process", "utils", "get_include"]
13+
__all__ = ["distance", "fuzz", "get_include", "process", "utils"]
1414

1515

1616
def get_include():

src/rapidfuzz/_utils.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,7 @@ def is_none(s: Any) -> bool:
6464
if s is None or s is pandas_NA:
6565
return True
6666

67-
if isinstance(s, float) and isnan(s):
68-
return True
69-
70-
return False
67+
return isinstance(s, float) and isnan(s)
7168

7269

7370
def add_scorer_attrs(func: Any, cached_scorer_call: dict[str, Callable[..., dict[str, Any]]]):

src/rapidfuzz/distance/__init__.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,20 @@
1818
from ._initialize import Editop, Editops, MatchingBlock, Opcode, Opcodes, ScoreAlignment
1919

2020
__all__ = [
21+
"OSA",
22+
"DamerauLevenshtein",
2123
"Editop",
2224
"Editops",
23-
"Opcode",
24-
"Opcodes",
25-
"ScoreAlignment",
26-
"MatchingBlock",
27-
"DamerauLevenshtein",
2825
"Hamming",
2926
"Indel",
3027
"Jaro",
3128
"JaroWinkler",
3229
"LCSseq",
3330
"Levenshtein",
34-
"OSA",
35-
"Prefix",
31+
"MatchingBlock",
32+
"Opcode",
33+
"Opcodes",
3634
"Postfix",
35+
"Prefix",
36+
"ScoreAlignment",
3737
]

src/rapidfuzz/distance/metrics_py.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -246,11 +246,11 @@ def _get_scorer_flags_levenshtein_normalized_similarity(
246246

247247
__all__ += [
248248
"levenshtein_distance",
249+
"levenshtein_editops",
249250
"levenshtein_normalized_distance",
250251
"levenshtein_normalized_similarity",
251-
"levenshtein_similarity",
252-
"levenshtein_editops",
253252
"levenshtein_opcodes",
253+
"levenshtein_similarity",
254254
]
255255

256256

@@ -261,11 +261,11 @@ def _get_scorer_flags_levenshtein_normalized_similarity(
261261

262262
__all__ += [
263263
"lcs_seq_distance",
264+
"lcs_seq_editops",
264265
"lcs_seq_normalized_distance",
265266
"lcs_seq_normalized_similarity",
266-
"lcs_seq_similarity",
267-
"lcs_seq_editops",
268267
"lcs_seq_opcodes",
268+
"lcs_seq_similarity",
269269
]
270270

271271

@@ -276,11 +276,11 @@ def _get_scorer_flags_levenshtein_normalized_similarity(
276276

277277
__all__ += [
278278
"indel_distance",
279+
"indel_editops",
279280
"indel_normalized_distance",
280281
"indel_normalized_similarity",
281-
"indel_similarity",
282-
"indel_editops",
283282
"indel_opcodes",
283+
"indel_similarity",
284284
]
285285

286286

@@ -291,9 +291,9 @@ def _get_scorer_flags_levenshtein_normalized_similarity(
291291

292292
__all__ += [
293293
"hamming_distance",
294+
"hamming_editops",
294295
"hamming_normalized_distance",
295296
"hamming_normalized_similarity",
296-
"hamming_similarity",
297-
"hamming_editops",
298297
"hamming_opcodes",
298+
"hamming_similarity",
299299
]

src/rapidfuzz/process_cpp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
extractOne,
2222
)
2323

24-
__all__ = ["extract", "extract_iter", "extractOne", "cdist", "cpdist"]
24+
__all__ = ["cdist", "cpdist", "extract", "extractOne", "extract_iter"]
2525

2626

2727
def _dtype_to_type_num(dtype):

0 commit comments

Comments
 (0)