Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down Expand Up @@ -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
Expand Down
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