Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-commit hook to disallow improper comparison to _nxver #22

Merged
merged 4 commits into from
Nov 21, 2024
Merged
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
17 changes: 14 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace
- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.22
rev: v0.23
hooks:
- id: validate-pyproject
name: Validate pyproject.toml
Expand All @@ -51,7 +51,7 @@ repos:
- id: black
# - id: black-jupyter # Consider adding this
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.7.4
hooks:
- id: ruff
args: [--fix-only, --show-fixes] # --unsafe-fixes]
Expand Down Expand Up @@ -79,7 +79,7 @@ repos:
files: ^(nx_cugraph|docs)/
args: ["-L thirdparty,coo,COO,numer"]
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.3
rev: v0.7.4
hooks:
- id: ruff
# Don't have strict linting for miscellaneous code
Expand Down Expand Up @@ -109,6 +109,17 @@ repos:
language: python
pass_filenames: false
additional_dependencies: ["networkx>=3.4"]
- repo: local
hooks:
- id: disallow-improper-nxver-comparison
name: disallow improper comparison to `_nxver`
language: pygrep
# We expect bug-fix releases to be the same, so these rules avoid cases like:
# >>> (X, Y, 1) <= (X, Y)
# False
entry: "_nxver > |_nxver <= | < _nxver| >= _nxver"
# Use e.g. `_nxver < ...` or `_nxver >= ...` instead
exclude: .pre-commit-config.yaml
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v1.0.0
hooks:
Expand Down
Loading