Skip to content

Commit

Permalink
MAINT: autoupdate pre-commit hooks (#9)
Browse files Browse the repository at this point in the history
* DX: activate `ALL` Ruff rules
* DX: add Jupyter Lab extensions
* DX: implement `.envrc` for `direnv`
* DX: switch to Python 3.12 as developer version
* MAINT: address Ruff issues
* MAINT: remove empty tags from notebook cell metadata
  • Loading branch information
pre-commit-ci[bot] authored Aug 7, 2024
1 parent e51351f commit d7e2916
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 41 deletions.
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
layout anaconda
10 changes: 6 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@ repos:
- id: check-useless-excludes

- repo: https://github.com/ComPWA/policy
rev: 0.3.4
rev: 0.3.18
hooks:
- id: colab-toc-visible
- id: check-dev-files
args:
- --dev-python-version=3.12
- --no-github-actions
- --no-gitpod
- --no-prettierrc
- --no-pypi
- --repo-name=jax-mini-benchmark
- id: remove-empty-tags

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.5
rev: v0.5.6
hooks:
- id: ruff
args: [--fix]
Expand All @@ -34,7 +36,7 @@ repos:
types_or: [python, pyi, jupyter]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-ast
- id: check-case-conflict
Expand Down Expand Up @@ -76,6 +78,6 @@ repos:
)$
- repo: https://github.com/ComPWA/mirrors-pyright
rev: v1.1.357
rev: v1.1.374
hooks:
- id: pyright
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"notebook.formatOnSave.enabled": true,
"python.analysis.typeCheckingMode": "strict",
"python.terminal.activateEnvironment": false,
"redhat.telemetry.enabled": false,
"rewrap.wrappingColumn": 88,
"ruff.enable": true,
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: jax-mini-benchmark
channels:
- defaults
dependencies:
- python==3.9.*
- python==3.12.*
- pip
- pip:
- -e .[dev]
Expand Down
60 changes: 24 additions & 36 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ dev = [
"jax-mini-benchmark[sty]",
]
jupyter = [
"black",
"isort",
"jupyterlab",
"jupyterlab-code-formatter",
"jupyterlab-code-formatter >=3.0.0",
"jupyterlab-git",
"jupyterlab-lsp",
"jupyterlab-myst",
Expand Down Expand Up @@ -128,39 +126,10 @@ docstring-code-format = true
line-ending = "lf"

[tool.ruff.lint]
extend-select = [
"A",
"B",
"BLE",
"C4",
"C90",
"D",
"EM",
"ERA",
"FA",
"I",
"ICN",
"INP",
"ISC",
"N",
"NPY",
"PGH",
"PIE",
"PL",
"Q",
"RET",
"RSE",
"RUF",
"S",
"SIM",
"T20",
"TCH",
"TID",
"TRY",
"UP",
"YTT",
]
ignore = [
"ANN401",
"COM812",
"CPY001",
"D100",
"D101",
"D102",
Expand All @@ -172,28 +141,47 @@ ignore = [
"D213",
"D407",
"D416",
"DOC",
"E501",
"FBT00",
"FURB101",
"FURB103",
"FURB140",
"G004",
"ISC001",
"PLC0415",
"PLW1514",
"PT001",
"PTH",
"S404",
"S602",
"SIM108",
"T201",
]
select = ["ALL"]
task-tags = ["cspell"]

[tool.ruff.lint.flake8-builtins]
builtins-allowed-modules = ["io"]
builtins-ignorelist = ["display"]

[tool.ruff.lint.flake8-comprehensions]
allow-dict-calls-with-keyword-arguments = true

[tool.ruff.lint.isort]
split-on-trailing-comma = false

[tool.ruff.lint.per-file-ignores]
"*.ipynb" = [
"ANN",
"B018",
"C90",
"D",
"E303",
"E703",
"N806",
"N816",
"PD901",
"PLR09",
"PLR2004",
"PLW0602",
Expand All @@ -202,7 +190,7 @@ split-on-trailing-comma = false
"T20",
"TCH00",
]
"visualize-benchmark.ipynb" = ["S301", "S403"]
"visualize-benchmark.ipynb" = ["S301", "S403", "W391"]

[tool.ruff.lint.pydocstyle]
convention = "google"
Expand Down

0 comments on commit d7e2916

Please sign in to comment.