Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt ruff format #304

Merged
merged 1 commit into from
Oct 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 5 additions & 9 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-case-conflict
- id: check-ast
Expand Down Expand Up @@ -43,16 +43,11 @@ repos:
- id: blacken-docs
additional_dependencies: [black==23.7.0]

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

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
hooks:
- id: codespell
args: ["-L", "sur,nd"]
args: ["-L", "ans,te,manuel"]

- repo: https://github.com/pre-commit/pygrep-hooks
rev: "v1.10.0"
Expand All @@ -62,13 +57,14 @@ repos:
- id: rst-inline-touching-normal

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

- repo: https://github.com/scientific-python/cookie
rev: "2023.09.21"
rev: "2023.10.27"
hooks:
- id: sp-repo-review
additional_dependencies: ["repo-review[cli]"]
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "pydata_sphinx_theme"
html_theme_options = {"navigation_with_keys": False}

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand Down
29 changes: 8 additions & 21 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,20 @@ test = "mypy --install-types --non-interactive {args:oct2py}"

[tool.hatch.envs.lint]
dependencies = [
"black[jupyter]==23.3.0",
"mdformat>0.7",
"mdformat-gfm>=0.3.5",
"ruff==0.0.282"
"ruff==0.1.3"
]
detached = true
[tool.hatch.envs.lint.scripts]
style = [
"ruff {args:.}",
"black --check --diff --color {args:.}",
"ruff format {args:.}",
"mdformat --check {args:docs *.md}"
]
fmt = [
"black {args:.}",
"ruff --fix {args:.}",
"ruff format {args:.}",
"mdformat {args:docs *.md}"
]

Expand Down Expand Up @@ -145,22 +144,13 @@ warn_return_any = true
warn_unreachable = true
warn_unused_ignores = true

[[tool.mypy.overrides]]
module = [
]
ignore_missing_imports = true

[tool.black]
line-length = 100
target-version = ["py37"]
skip-string-normalization = true


[tool.ruff]
target-version = "py37"
target-version = "py38"
line-length = 100

[tool.ruff.lint]
select = [
"A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "ISC", "N",
"A", "B", "C", "DTZ", "E", "EM", "F", "FBT", "I", "ICN", "N",
"PLC", "PLE", "PLR", "PLW", "Q", "RUF", "S", "SIM", "T", "TID", "UP",
"W", "YTT",
]
Expand All @@ -175,7 +165,7 @@ ignore = [
"C408", "C409"
]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
# S101 Use of `assert` detected
# N806 Variable `V` in function should be lowercase
# PLR2004 Magic value used in comparison
Expand All @@ -195,6 +185,3 @@ exclude = ["tests", "docs"]

[tool.repo-review]
ignore = ["PY007", "PP308", "GH102", "PC140", "MY101"]

[tool.codespell]
ignore-words-list = "ans,te,manuel"
Loading