Skip to content

Commit 16713bb

Browse files
benjefferymergify[bot]
authored andcommitted
Fix and update pre-commit
1 parent 964d651 commit 16713bb

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

.pre-commit-config.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.1.0
3+
rev: v4.3.0
44
hooks:
55
- id: check-merge-conflict
66
- id: debug-statements
@@ -12,33 +12,33 @@ repos:
1212
hooks:
1313
- id: copyright-year
1414
- repo: https://github.com/benjeffery/pre-commit-clang-format
15-
rev: c21a74d089aaeb86c2c19df371c7e7bf40c07207
15+
rev: '1.0'
1616
hooks:
1717
- id: clang-format
1818
exclude: dev-tools|examples
1919
verbose: true
2020
- repo: https://github.com/asottile/reorder_python_imports
21-
rev: v3.0.1
21+
rev: v3.9.0
2222
hooks:
2323
- id: reorder-python-imports
2424
args: [--application-directories=python,
2525
--unclassifiable-application-module=_tskit]
2626
- repo: https://github.com/asottile/pyupgrade
27-
rev: v2.31.1
27+
rev: v3.2.2
2828
hooks:
2929
- id: pyupgrade
3030
args: [--py3-plus, --py37-plus]
3131
- repo: https://github.com/psf/black
32-
rev: 22.3.0
32+
rev: 22.10.0
3333
hooks:
3434
- id: black
3535
language_version: python3
36-
- repo: https://gitlab.com/pycqa/flake8
37-
rev: 3.9.2
36+
- repo: https://github.com/pycqa/flake8
37+
rev: 5.0.4
3838
hooks:
3939
- id: flake8
4040
args: [--config=python/.flake8]
41-
additional_dependencies: ["flake8-bugbear==22.3.23", "flake8-builtins==1.5.3"]
41+
additional_dependencies: ["flake8-bugbear==22.10.27", "flake8-builtins==2.0.1"]
4242
- repo: https://github.com/asottile/blacken-docs
4343
rev: v1.12.1
4444
hooks:

python/tests/test_drawing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2407,7 +2407,7 @@ def verify_known_svg(self, svg, filename, save=False, **kwargs):
24072407
svg_fn = pathlib.Path(__file__).parent / "data" / "svg" / filename
24082408
if save:
24092409
logging.warning(f"Overwriting SVG file `{svg_fn}` with new version")
2410-
with open(svg_fn, "wt") as file:
2410+
with open(svg_fn, "w") as file:
24112411
file.write(svg)
24122412
with open(svg_fn, "rb") as file:
24132413
expected_svg = file.read()

python/tests/test_lowlevel.py

+7-3
Original file line numberDiff line numberDiff line change
@@ -2318,22 +2318,26 @@ def test_summary_func_errors(self):
23182318
for exception in [ValueError, TypeError]:
23192319

23202320
def f(x):
2321-
raise exception("test")
2321+
raise exception("test") # noqa: B023
23222322

23232323
with pytest.raises(exception):
23242324
ts.general_stat(W, f, 1, ts.get_breakpoints())
23252325

23262326
# Wrong output dimensions
23272327
for bad_array in [[1, 1], range(10)]:
23282328
with pytest.raises(ValueError):
2329-
ts.general_stat(W, lambda x: bad_array, 1, ts.get_breakpoints())
2329+
ts.general_stat(
2330+
W, lambda x: bad_array, 1, ts.get_breakpoints() # noqa:B023
2331+
)
23302332
with pytest.raises(ValueError):
23312333
ts.general_stat(W, lambda x: [1], 2, ts.get_breakpoints())
23322334

23332335
# Bad arrays returned from f
23342336
for bad_array in [["sdf"], 0, "w4", None]:
23352337
with pytest.raises(ValueError):
2336-
ts.general_stat(W, lambda x: bad_array, 1, ts.get_breakpoints())
2338+
ts.general_stat(
2339+
W, lambda x: bad_array, 1, ts.get_breakpoints() # noqa:B023
2340+
)
23372341

23382342

23392343
class TestVariant(LowLevelTestCase):

0 commit comments

Comments
 (0)