diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index dd0a9a07..c7d3c99b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,16 +39,6 @@ repos: - --repo-title=AmpForm-DPD - id: colab-toc-visible - - repo: https://github.com/nbQA-dev/nbQA - rev: 1.7.1 - hooks: - - id: nbqa-pyupgrade - args: - - --py38-plus - - id: nbqa-ruff - args: - - --fix - - repo: https://github.com/psf/black-pre-commit-mirror rev: 23.11.0 hooks: @@ -108,19 +98,12 @@ repos: hooks: - id: pyright - - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 - hooks: - - id: pyupgrade - args: - - --py38-plus - - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.1.6 hooks: - id: ruff - args: - - --fix + args: [--fix] + types_or: [python, pyi, jupyter] - repo: https://github.com/ComPWA/mirrors-taplo rev: v0.8.1 diff --git a/pyproject.toml b/pyproject.toml index 27730912..d7e1aeb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -69,10 +69,14 @@ jax = [ ] jupyter = [ "ampform-dpd[doc]", + "isort", + "jupyterlab", "jupyterlab >=3.0", "jupyterlab-code-formatter", + "jupyterlab-git", "jupyterlab-lsp", "jupyterlab-myst", + "python-lsp-ruff", "python-lsp-server[rope]", ] lint = [ @@ -151,21 +155,6 @@ target-version = [ "py39", ] -[tool.nbqa.addopts] -ruff = [ - "--extend-ignore=B018", - "--extend-ignore=C90", - "--extend-ignore=D", - "--extend-ignore=N806", - "--extend-ignore=N816", - "--extend-ignore=PLR09", - "--extend-ignore=PLR2004", - "--extend-ignore=PLW0602", - "--extend-ignore=PLW0603", - "--extend-ignore=PLW2901", - "--line-length=85", -] - [tool.pyright] reportGeneralTypeIssues = false reportImportCycles = false @@ -214,6 +203,7 @@ testpaths = [ ] [tool.ruff] +extend-include = ["*.ipynb"] extend-select = [ "A", "B", @@ -287,6 +277,23 @@ ignore-names = [ [tool.ruff.per-file-ignores] "*" = ["D"] +"*.ipynb" = [ + "B018", + "C90", + "D", + "E402", + "E703", + "N806", + "N816", + "PLR09", + "PLR2004", + "PLW0602", + "PLW0603", + "PLW2901", + "S101", + "T201", + "TCH00", +] "docs/*" = [ "E402", "INP001",