From 8f3e1bf2eb76366328386a1fa3098e342eb4e160 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 18 Oct 2024 15:15:47 -0400 Subject: [PATCH 1/2] add torchfix Signed-off-by: Jinzhe Zeng --- .pre-commit-config.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 6a1d303f64..51de1893b3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -38,6 +38,14 @@ repos: - id: ruff-format exclude: ^source/3rdparty types_or: [python, pyi, jupyter] + - repo: https://github.com/pycqa/flake8 + # flake8 cannot autofix + rev: "7.1.1" + hooks: + - id: flake8 + additional_dependencies: + - torchfix==0.6.0 + - flake8-pyproject==1.2.3 # numpydoc - repo: https://github.com/Carreau/velin rev: 0.0.12 From b09629036fa185eeead3da1ad3c4d72ebc46284f Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 18 Oct 2024 15:57:49 -0400 Subject: [PATCH 2/2] update config Signed-off-by: Jinzhe Zeng --- pyproject.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index b13dceeb07..4dbff24f13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -419,3 +419,10 @@ plugins = ["source.3rdparty.coverage_plugins.jit_plugin"] load-plugins = "deepmd_checker" disable = "all" enable = "E8001,E8002" + +[tool.flake8] +select = [ + "TOR0", + "TOR1", + "TOR2", +]