Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…om_checkers.html#defining-a-message, the message-id should be a 4-digit number, prefixed with a message category.

Signed-off-by: Jinzhe Zeng <jinzhe.zeng@rutgers.edu>
  • Loading branch information
njzjz committed Sep 27, 2024
1 parent 1a3c5b5 commit 3d4d380
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 2 additions & 2 deletions source/checker/README.md
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions source/checker/deepmd_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down

0 comments on commit 3d4d380

Please sign in to comment.