From 3d4d38010af7d0db172a84a22f38526897a02b81 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Fri, 27 Sep 2024 15:37:54 -0400 Subject: [PATCH] per https://pylint.pycqa.org/en/latest/development_guide/how_tos/custom_checkers.html#defining-a-message, the message-id should be a 4-digit number, prefixed with a message category. Signed-off-by: Jinzhe Zeng --- pyproject.toml | 2 +- source/checker/README.md | 4 ++-- source/checker/deepmd_checker.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) 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.",