Skip to content

Commit

Permalink
chore: Update pre-commit (#1454)
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro authored Nov 7, 2024
1 parent a405226 commit 62c691f
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 53 deletions.
75 changes: 34 additions & 41 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
# This is the configuration for pre-commit, a local framework for managing pre-commit hooks
# Check out the docs at: https://pre-commit.com/

default_stages: [commit]
default_stages: [pre-commit]
repos:
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.8.5
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: nbqa-ruff
additional_dependencies: [ruff==0.3.7]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
- id: check-builtin-literals
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-toml
- id: detect-private-key
- id: end-of-file-fixer
exclude: (\.min\.js$|\.svg$)
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.7
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.7.2
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/hoxbro/clean_notebook
rev: v0.1.14
- id: ruff
- id: ruff-format
exclude: \.ipynb$
- repo: https://github.com/hoxbro/clean_notebook
rev: v0.1.15
hooks:
- id: clean-notebook
args: [-i, tags]
- repo: https://github.com/codespell-project/codespell
rev: v2.2.6
- id: clean-notebook
args: [-i, tags]
- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
hooks:
- id: codespell
exclude: (\.min\.js$|\.svg$|\.html$)
additional_dependencies:
- tomli
- repo: local
- id: codespell
exclude: (\.min\.js$|\.svg$|\.html$)
additional_dependencies:
- tomli
- repo: local
hooks:
- id: update_conda_envs
name: Update conda envs
entry: python scripts/update_conda_envs.py
language: python
additional_dependencies: [pyproject2conda]
files: '(pyproject.toml|update_conda_envs)'
pass_filenames: false
- id: update_conda_envs
name: Update conda envs
entry: python scripts/update_conda_envs.py
language: python
additional_dependencies: [pyproject2conda]
files: "(pyproject.toml|update_conda_envs)"
pass_filenames: false
10 changes: 5 additions & 5 deletions doc/user_guide/NetworkX.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,10 @@
"\n",
"print(\"radius: %d\" % nx.radius(G))\n",
"print(\"diameter: %d\" % nx.diameter(G))\n",
"print(\"eccentricity: %s\" % nx.eccentricity(G))\n",
"print(\"center: %s\" % nx.center(G))\n",
"print(\"periphery: %s\" % nx.periphery(G))\n",
"print(\"density: %s\" % nx.density(G))\n",
"print(f\"eccentricity: {nx.eccentricity(G)}\")\n",
"print(f\"center: {nx.center(G)}\")\n",
"print(f\"periphery: {nx.periphery(G)}\")\n",
"print(f\"density: {nx.density(G)}\")\n",
"\n",
"hvnx.draw(G, with_labels=True)"
]
Expand Down Expand Up @@ -757,7 +757,7 @@
" edge_width=5.0\n",
" )\n",
" other_edges.append(edge)\n",
" plots.append((g*edges*hv.Overlay(other_edges)).relabel(\"p = %6.3f\" % (p)))\n",
" plots.append((g*edges*hv.Overlay(other_edges)).relabel(f\"p = {p:6.3f}\"))\n",
"\n",
"hv.Layout(plots).cols(2)"
]
Expand Down
8 changes: 1 addition & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ filterwarnings = [
]

[tool.codespell]
ignore-words-list = "ser"
ignore-words-list = "ser,assertIn"
skip = "doc/generate_modules.py"
write-changes = true

Expand All @@ -211,12 +211,6 @@ extend-select = [
[tool.ruff.format]
quote-style = "single"

[tool.nbqa.addopts]
# E402 Module level import not at top of file
ruff = [
"--extend-ignore=E402"
]

[tool.pyproject2conda.dependencies]
geoviews = { skip = true, packages = "geoviews-core >=1.9.0" }
# It should be ibis-framework[duckdb], but it works anyway.
Expand Down

0 comments on commit 62c691f

Please sign in to comment.