diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d2fc1d0ab8..5d34f39752 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,7 +29,7 @@ repos: exclude: ^source/3rdparty - repo: https://github.com/astral-sh/ruff-pre-commit # Ruff version. - rev: v0.6.5 + rev: v0.6.7 hooks: - id: ruff args: ["--fix"] @@ -146,7 +146,7 @@ repos: exclude: .pre-commit-config.yaml|source/lmp # customized pylint rules - repo: https://github.com/pylint-dev/pylint/ - rev: v3.2.7 + rev: v3.3.0 hooks: - id: pylint entry: env PYTHONPATH=source/checker pylint diff --git a/pyproject.toml b/pyproject.toml index 28fe114e01..a1829016cb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -414,4 +414,4 @@ plugins = ["source.3rdparty.coverage_plugins.jit_plugin"] [tool.pylint.'MESSAGES CONTROL'] load-plugins = "deepmd_checker" disable = "all" -enable = "EDP01,EDP02" +enable = "E8001,E8002" diff --git a/source/checker/README.md b/source/checker/README.md index 2a905f93a5..368852034c 100644 --- a/source/checker/README.md +++ b/source/checker/README.md @@ -1,4 +1,4 @@ # DeePMD-kit customized Pylint plugin -- EDP01: Require explicit device when initializing a PyTorch tensor. -- EDP02: Require explicit dtype when initializing a NumPy array, a TensorFlow tensor, or a PyTorch tensor. +- E8001: Require explicit device when initializing a PyTorch tensor. +- E8002: Require explicit dtype when initializing a NumPy array, a TensorFlow tensor, or a PyTorch tensor. diff --git a/source/checker/deepmd_checker.py b/source/checker/deepmd_checker.py index 052d011c47..d763835fdc 100644 --- a/source/checker/deepmd_checker.py +++ b/source/checker/deepmd_checker.py @@ -21,12 +21,12 @@ class DPChecker(BaseChecker): name = "deepmd-checker" msgs: ClassVar[dict] = { - "EDP01": ( + "E8001": ( "No explicit device.", "no-explicit-device", "Require explicit device when initializing a PyTorch tensor.", ), - "EDP02": ( + "E8002": ( "No explicit dtype.", "no-explicit-dtype", "Require explicit dtype when initializing a NumPy array, a TensorFlow tensor, or a PyTorch tensor.",