diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3e9851b0f..933b7741a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/doc/user_guide/NetworkX.ipynb b/doc/user_guide/NetworkX.ipynb index 90c0777c7..7f6693c06 100644 --- a/doc/user_guide/NetworkX.ipynb +++ b/doc/user_guide/NetworkX.ipynb @@ -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)" ] @@ -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)" ] diff --git a/pyproject.toml b/pyproject.toml index d1c6c28c9..65f438ce1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -196,7 +196,7 @@ filterwarnings = [ ] [tool.codespell] -ignore-words-list = "ser" +ignore-words-list = "ser,assertIn" skip = "doc/generate_modules.py" write-changes = true @@ -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.