Skip to content
Closed
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
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,25 @@ repos:
hooks:
- id: velin
args: ["--write"]
# markdown
- repo: https://github.com/hukkin/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
# - mdformat-myst==0.3.0
# See https://github.com/executablebooks/mdformat-myst/issues/13
- "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
- mdformat-ruff==0.1.3
- mdformat-web==0.2.0
- mdformat-config==0.2.1
- mdformat-beautysh==1.0.0
- mdformat-gfm-alerts==2.0.0
# yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [yaml]
Comment on lines +42 to +61

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix YAML indentation so new repos are top‑level list items.

The markdown/yaml hooks are indented under the previous repo mapping, which makes the YAML invalid (matches the YAMLlint error) and will break pre-commit parsing. Align them with the other top‑level repos entries.

✅ Proposed fix
-  # markdown
-  - repo: https://github.com/hukkin/mdformat
-    rev: 1.0.0
-    hooks:
-      - id: mdformat
-        additional_dependencies:
-          # - mdformat-myst==0.3.0
-          # See https://github.com/executablebooks/mdformat-myst/issues/13
-          - "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
-          - mdformat-ruff==0.1.3
-          - mdformat-web==0.2.0
-          - mdformat-config==0.2.1
-          - mdformat-beautysh==1.0.0
-          - mdformat-gfm-alerts==2.0.0
-  # yaml
-  - repo: https://github.com/pre-commit/mirrors-prettier
-    rev: v4.0.0-alpha.8
-    hooks:
-      - id: prettier
-        types_or: [yaml]
+# markdown
+- repo: https://github.com/hukkin/mdformat
+  rev: 1.0.0
+  hooks:
+    - id: mdformat
+      additional_dependencies:
+        # - mdformat-myst==0.3.0
+        # See https://github.com/executablebooks/mdformat-myst/issues/13
+        - "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
+        - mdformat-ruff==0.1.3
+        - mdformat-web==0.2.0
+        - mdformat-config==0.2.1
+        - mdformat-beautysh==1.0.0
+        - mdformat-gfm-alerts==2.0.0
+# yaml
+- repo: https://github.com/pre-commit/mirrors-prettier
+  rev: v4.0.0-alpha.8
+  hooks:
+    - id: prettier
+      types_or: [yaml]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# markdown
- repo: https://github.com/hukkin/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
# - mdformat-myst==0.3.0
# See https://github.com/executablebooks/mdformat-myst/issues/13
- "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
- mdformat-ruff==0.1.3
- mdformat-web==0.2.0
- mdformat-config==0.2.1
- mdformat-beautysh==1.0.0
- mdformat-gfm-alerts==2.0.0
# yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [yaml]
# markdown
- repo: https://github.com/hukkin/mdformat
rev: 1.0.0
hooks:
- id: mdformat
additional_dependencies:
# - mdformat-myst==0.3.0
# See https://github.com/executablebooks/mdformat-myst/issues/13
- "git+https://github.com/njzjz-bothub/mdformat-myst@d9c414e#egg=mdformat-myst"
- mdformat-ruff==0.1.3
- mdformat-web==0.2.0
- mdformat-config==0.2.1
- mdformat-beautysh==1.0.0
- mdformat-gfm-alerts==2.0.0
# yaml
- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
hooks:
- id: prettier
types_or: [yaml]
🧰 Tools
🪛 YAMLlint (1.38.0)

[error] 43-43: syntax error: expected , but found ''

(syntax)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 42 - 61, The YAML has the markdown and
yaml hook blocks nested under the previous repo mapping; move the "- repo:
https://github.com/hukkin/mdformat" and "- repo:
https://github.com/pre-commit/mirrors-prettier" entries out to be top-level list
items under the main "repos:" sequence so each "- repo: ..." starts at the same
indentation as other repo entries; ensure their inner "rev:" and "hooks:"
mappings are indented one level under each "- repo" (use 2 spaces per level) so
the mdformat and prettier hooks are valid top-level repo entries.

Comment on lines +57 to +61

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# List recent releases to confirm latest stable vs alpha.
gh release list -R pre-commit/mirrors-prettier --limit 10

Repository: deepmodeling/dpgen

Length of output: 243


🌐 Web query:

Prettier v4 latest stable release vs v4.0.0-alpha.8

💡 Result:

  • Latest stable Prettier (as of Feb 24, 2026): v3.8.1 (published Jan 21, 2026). This is the version you get from the npm latest tag and is recommended for production use. [1]
  • Prettier v4.0.0-alpha.8: a prerelease (alpha) from Dec 20, 2023—meant for testing upcoming v4 changes and more likely to have breaking changes/instability than stable releases. [2]
  • Context: v4 has continued to ship newer alphas after alpha.8 (e.g., v4.0.0-alpha.13 on Nov 18, 2025), so alpha.8 is also quite old compared to the current v4 prerelease line. [3]

Practical choice: use v3.8.1 unless you specifically need to test v4 behavior; if you do, prefer the latest v4 alpha rather than alpha.8. [1][3]

Sources: [1] Snyk (npm prettier versions list), [2] Libraries.io (prettier version timeline incl. 4.0.0-alpha.8), [3] ReleaseAlert (prettier release timeline incl. 4.0.0-alpha.13).


Pin Prettier to the latest stable release (v3.8.1).

v4.0.0-alpha.8 (Dec 2023) is outdated and unstable. It will cause formatter churn and unpredictable behavior. Use v3.8.1 (the current stable release as of Jan 2026) unless there is a specific requirement to test Prettier v4 features—in which case, use a newer v4 alpha (e.g., v4.0.0-alpha.13) rather than the old alpha.8.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.pre-commit-config.yaml around lines 57 - 61, Update the Prettier hook in
the pre-commit config by changing the mirrors-prettier rev from "v4.0.0-alpha.8"
to the stable release "v3.8.1" for the hook with id "prettier" (the block that
currently lists repo: https://github.com/pre-commit/mirrors-prettier and
types_or: [yaml]); this pins Prettier to the stable version to avoid formatter
churn—if you need v4 testing instead, use a newer v4 alpha (e.g.,
"v4.0.0-alpha.13") rather than the old alpha.8.

ci:
autoupdate_branch: devel