Skip to content

Commit

Permalink
chore: use Ruff-format, modernize (#28)
Browse files Browse the repository at this point in the history
Modernize config too.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
henryiii and pre-commit-ci[bot] authored Nov 28, 2023
1 parent 271bf24 commit b821514
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 19 deletions.
11 changes: 4 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ ci:
autoupdate_commit_msg: "chore: update pre-commit hooks"

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.11.0
hooks:
- id: black-jupyter

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
Expand Down Expand Up @@ -39,17 +34,18 @@ repos:
types_or: [yaml, markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/asottile/blacken-docs
- repo: https://github.com/adamchainz/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.3.0]
additional_dependencies: [black==23.*]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.6"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.7.1
Expand All @@ -62,6 +58,7 @@ repos:
rev: v2.2.6
hooks:
- id: codespell
args: ["-w"]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
Expand Down
18 changes: 6 additions & 12 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ show_error_codes = true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
warn_unreachable = true


[tool.ruff]
src = ["src"]

[tool.ruff.lint]
select = [
"E", "F", "W", # flake8
"B", # flake8-bugbear
"I", # isort
"ARG", # flake8-unused-arguments
Expand All @@ -103,19 +104,12 @@ select = [
"NPY", # NumPy specific rules
"PD", # pandas-vet
]
extend-ignore = [
"PLR", # Design related pylint codes
"E501", # Line too long
]
src = ["src"]
unfixable = [
"T20", # Removes print statements
"F841", # Removes unused variables
ignore = [
"PLR2004", # Magic value used in comparison
]
flake8-unused-arguments.ignore-variadic-names = true
isort.required-imports = ["from __future__ import annotations"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/**" = ["T20"]


Expand Down

0 comments on commit b821514

Please sign in to comment.