Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 1, 2024
1 parent 6e273dc commit 142f5b3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 51 deletions.
48 changes: 16 additions & 32 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ci:
autoupdate_commit_msg: "MAINT: autoupdate pre-commit hooks"
autoupdate_schedule: quarterly
skip:
- prettier
- pyright
- taplo

Expand All @@ -11,6 +12,17 @@ repos:
- id: check-hooks-apply
- id: check-useless-excludes

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.11
hooks:
- id: check-dev-files
args:
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --repo-name=ComPWA benchmarks
- --repo-title=benchmarks
- id: colab-toc-visible
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand All @@ -26,29 +38,8 @@ repos:
- id: mixed-line-ending
- id: trailing-whitespace

- repo: https://github.com/ComPWA/repo-maintenance
rev: 0.1.11
hooks:
- id: check-dev-files
args:
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --repo-name=ComPWA benchmarks
- --repo-title=benchmarks
- id: colab-toc-visible
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.1
hooks:
- id: nbqa-pyupgrade
args:
- --py37-plus
- id: nbqa-ruff
args:
- --fix

- repo: https://github.com/psf/black
rev: 23.12.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: PLEASE-UPDATE
hooks:
- id: black
- id: black-jupyter
Expand Down Expand Up @@ -101,19 +92,12 @@ repos:
hooks:
- id: pyright

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
hooks:
- id: pyupgrade
args:
- --py37-plus

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.9
hooks:
- id: ruff
args:
- --fix
args: [--fix]
types_or: [python, pyi, jupyter]

- repo: https://github.com/ComPWA/mirrors-taplo
rev: v0.8.1
Expand Down
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
},
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.rulers": [88]
Expand All @@ -27,13 +27,15 @@
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"black-formatter.importStrategy": "fromEnvironment",
"diffEditor.experimental.showMoves": true,
"editor.formatOnSave": true,
"files.associations": {
".cspell/*.txt": "plaintext"
},
"files.eol": "\n",
"github-actions.workflows.pinned.workflows": [".github/workflows/ci.yml"],
"livePreview.defaultPreviewPath": "docs/_build/html",
"multiDiffEditor.experimental.enabled": true,
"notebook.gotoSymbols.showAllSymbols": true,
"python.analysis.autoImportCompletions": false,
"rewrap.wrappingColumn": 88,
Expand Down
2 changes: 2 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ dependencies:
- pip
- pip:
- -e .[dev]
variables:
PRETTIER_LEGACY_CLI: "1"
43 changes: 25 additions & 18 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,15 @@ format = [
"black",
]
jupyter = [
"isort",
"jupyterlab",
"jupyterlab >=3.0",
"jupyterlab-code-formatter",
"jupyterlab-git",
"jupyterlab-lsp",
"jupyterlab-myst",
"python-lsp-ruff",
"python-lsp-server[rope]",
'jupyterlab-myst; python_version >="3.7.0"',
]
lint = [
Expand Down Expand Up @@ -99,24 +106,6 @@ target-version = [
"py39",
]

[tool.nbqa.addopts]
ruff = [
"--extend-ignore=B018",
"--extend-ignore=C408",
"--extend-ignore=C90",
"--extend-ignore=D",
"--extend-ignore=N806",
"--extend-ignore=N816",
"--extend-ignore=PLR09",
"--extend-ignore=PLR2004",
"--extend-ignore=PLW0602",
"--extend-ignore=PLW0603",
"--line-length=85",
]

[tool.nbqa.exclude]
flake8 = "^docs/appendix/benchmark.ipynb"

[tool.pyright]
reportGeneralTypeIssues = false
reportImportCycles = false
Expand Down Expand Up @@ -163,6 +152,7 @@ testpaths = [
]

[tool.ruff]
extend-include = ["*.ipynb"]
extend-select = [
"A",
"B",
Expand Down Expand Up @@ -213,6 +203,23 @@ target-version = "py37"
task-tags = ["cspell"]

[tool.ruff.per-file-ignores]
"*.ipynb" = [
"B018",
"C408",
"C90",
"D",
"E402",
"E703",
"N806",
"N816",
"PLR09",
"PLR2004",
"PLW0602",
"PLW0603",
"S101",
"T20",
"TCH00",
]
"docs/*" = [
"E402",
"INP001",
Expand Down
1 change: 1 addition & 0 deletions scripts/execute_jax_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Execute JAX over a combination of physical cores."""

from __future__ import annotations

import logging
Expand Down
1 change: 1 addition & 0 deletions scripts/visualize_jax_benchmark.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Visualize benchmark results from :file:`execute_jax_benchmark.py`."""

from __future__ import annotations

import logging
Expand Down

0 comments on commit 142f5b3

Please sign in to comment.