Skip to content

Commit b838681

Browse files
Update pre-commit configuration
1 parent d49cf2f commit b838681

File tree

3 files changed

+53
-72
lines changed

3 files changed

+53
-72
lines changed

.pre-commit-config.yaml

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,33 @@
1+
exclude: |
2+
(?x)^(
3+
versioneer\.py|
4+
kanren/_version\.py|
5+
doc/.*|
6+
)$
17
repos:
28
- repo: https://github.com/psf/black
3-
rev: 20.8b1
9+
rev: 22.3.0
410
hooks:
511
- id: black
612
language_version: python3
7-
exclude: |
8-
(?x)^(
9-
versioneer\.py|
10-
kanren/_version\.py|
11-
doc/.*|
12-
bin/.*
13-
)$
1413
- repo: https://gitlab.com/pycqa/flake8
1514
rev: 3.8.4
1615
hooks:
1716
- id: flake8
18-
exclude: |
19-
(?x)^(
20-
versioneer\.py|
21-
kanren/_version\.py|
22-
doc/.*|
23-
bin/.*
24-
)$
2517
- repo: https://github.com/pycqa/isort
26-
rev: 5.5.2
18+
rev: 5.6.4
2719
hooks:
2820
- id: isort
21+
- repo: https://github.com/humitos/mirrors-autoflake.git
22+
rev: v1.1
23+
hooks:
24+
- id: autoflake
25+
- repo: https://github.com/pre-commit/pre-commit-hooks
26+
rev: v2.1.0
27+
hooks:
28+
- id: debug-statements
2929
exclude: |
30-
(?x)^(
31-
versioneer\.py|
32-
kanren/_version\.py|
33-
doc/.*|
34-
bin/.*
35-
)$
30+
(?x)^(
31+
kanren/core\.py
32+
)$
33+
- id: check-merge-conflict

tests/test_assoccomm.py

Lines changed: 27 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -320,19 +320,16 @@ def test_eq_assoc_args():
320320
== ()
321321
)
322322

323-
assert (
324-
run(
325-
0,
326-
True,
327-
eq_assoc_args(
328-
assoc_op,
329-
(1, (assoc_op, 2, 3)),
330-
((assoc_op, 1, 2), 3),
331-
no_ident=True,
332-
),
333-
)
334-
== (True,)
335-
)
323+
assert run(
324+
0,
325+
True,
326+
eq_assoc_args(
327+
assoc_op,
328+
(1, (assoc_op, 2, 3)),
329+
((assoc_op, 1, 2), 3),
330+
no_ident=True,
331+
),
332+
) == (True,)
336333

337334

338335
def test_eq_assoc():
@@ -417,37 +414,26 @@ def test_assoc_flatten():
417414
fact(commutative, mul)
418415
fact(associative, mul)
419416

420-
assert (
421-
run(
422-
0,
423-
True,
424-
assoc_flatten(
425-
(mul, 1, (add, 2, 3), (mul, 4, 5)), (mul, 1, (add, 2, 3), 4, 5)
426-
),
427-
)
428-
== (True,)
429-
)
417+
assert run(
418+
0,
419+
True,
420+
assoc_flatten((mul, 1, (add, 2, 3), (mul, 4, 5)), (mul, 1, (add, 2, 3), 4, 5)),
421+
) == (True,)
430422

431423
x = var()
432-
assert (
433-
run(
434-
0,
435-
x,
436-
assoc_flatten((mul, 1, (add, 2, 3), (mul, 4, 5)), x),
437-
)
438-
== ((mul, 1, (add, 2, 3), 4, 5),)
439-
)
424+
assert run(
425+
0,
426+
x,
427+
assoc_flatten((mul, 1, (add, 2, 3), (mul, 4, 5)), x),
428+
) == ((mul, 1, (add, 2, 3), 4, 5),)
440429

441-
assert (
442-
run(
443-
0,
444-
True,
445-
assoc_flatten(
446-
("op", 1, (add, 2, 3), (mul, 4, 5)), ("op", 1, (add, 2, 3), (mul, 4, 5))
447-
),
448-
)
449-
== (True,)
450-
)
430+
assert run(
431+
0,
432+
True,
433+
assoc_flatten(
434+
("op", 1, (add, 2, 3), (mul, 4, 5)), ("op", 1, (add, 2, 3), (mul, 4, 5))
435+
),
436+
) == (True,)
451437

452438
assert run(0, x, assoc_flatten(("op", 1, (add, 2, 3), (mul, 4, 5)), x)) == (
453439
("op", 1, (add, 2, 3), (mul, 4, 5)),

tests/test_core.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -235,15 +235,12 @@ def test_ifa():
235235
== ()
236236
)
237237

238-
assert (
239-
run(
240-
0,
241-
y,
242-
eq(x, True),
243-
ifa(lall(eq(x, True), eq(y, 1)), lall(eq(x, True), eq(y, 2))),
244-
)
245-
== (1,)
246-
)
238+
assert run(
239+
0,
240+
y,
241+
eq(x, True),
242+
ifa(lall(eq(x, True), eq(y, 1)), lall(eq(x, True), eq(y, 2))),
243+
) == (1,)
247244

248245

249246
def test_ground_order():

0 commit comments

Comments
 (0)