提交 0d0ee9d8 authored 作者: Brandon T. Willard's avatar Brandon T. Willard 提交者: Brandon T. Willard

Add autoflake to pre-commit setup

上级 12ef382b
...@@ -6,6 +6,20 @@ exclude: | ...@@ -6,6 +6,20 @@ exclude: |
bin/.* bin/.*
)$ )$
repos: repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.1.0
hooks:
- id: debug-statements
exclude: |
(?x)^(
aesara/breakpoint\.py|
aesara/graph/op\.py|
aesara/compile/nanguardmode\.py|
aesara/graph/opt\.py|
aesara/tensor/var\.py|
aesara/gpuarray/opt\.py
)$
- id: check-merge-conflict
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 20.8b1 rev: 20.8b1
hooks: hooks:
...@@ -19,3 +33,17 @@ repos: ...@@ -19,3 +33,17 @@ repos:
rev: 5.6.4 rev: 5.6.4
hooks: hooks:
- id: isort - id: isort
- repo: https://github.com/humitos/mirrors-autoflake.git
rev: v1.1
hooks:
- id: autoflake
exclude: |
(?x)^(
.*/?__init__\.py|
aesara/graph/toolbox\.py|
aesara/link/jax/jax_dispatch\.py|
aesara/link/jax/jax_linker\.py|
aesara/scalar/basic_scipy\.py|
aesara/tensor/linalg\.py
)$
args: ['--in-place', '--remove-all-unused-imports', '--remove-unused-variable']
...@@ -320,7 +320,6 @@ class TestSpecifyShape(utt.InferShapeTester): ...@@ -320,7 +320,6 @@ class TestSpecifyShape(utt.InferShapeTester):
4, 4,
], ],
) )
pass
def test_scalar_shapes(self): def test_scalar_shapes(self):
with pytest.raises(AssertionError, match="will never match"): with pytest.raises(AssertionError, match="will never match"):
...@@ -332,7 +331,6 @@ class TestSpecifyShape(utt.InferShapeTester): ...@@ -332,7 +331,6 @@ class TestSpecifyShape(utt.InferShapeTester):
y = specify_shape(x, shape=()) y = specify_shape(x, shape=())
f = aesara.function([x], y, mode=self.mode) f = aesara.function([x], y, mode=self.mode)
assert f(15) == 15 assert f(15) == 15
pass
def test_python_perform(self): def test_python_perform(self):
x = scalar() x = scalar()
...@@ -355,7 +353,6 @@ class TestSpecifyShape(utt.InferShapeTester): ...@@ -355,7 +353,6 @@ class TestSpecifyShape(utt.InferShapeTester):
AssertionError, match=r"Got shape \(3, 4\), expected \(2, 3\)." AssertionError, match=r"Got shape \(3, 4\), expected \(2, 3\)."
): ):
f(np.ones((3, 4)).astype(config.floatX), (2, 3)) f(np.ones((3, 4)).astype(config.floatX), (2, 3))
pass
def test_bad_shape(self): def test_bad_shape(self):
# Test that at run time we raise an exception when the shape # Test that at run time we raise an exception when the shape
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论