Skip to content

Commit

Permalink
Prepare to switch from black to ruff
Browse files Browse the repository at this point in the history
Will actually switch once we can pick up the fix for
astral-sh/ruff#8357.
  • Loading branch information
jab committed Nov 1, 2023
1 parent 41874e6 commit ea8b0c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
17 changes: 10 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,21 @@ repos:
- hypothesis
- pytest

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.292
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
# TODO: Switch from black (below) to ruff format once we can pick up the fix for
# https://github.com/astral-sh/ruff/issues/8357
# - id: ruff-format

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

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.6
hooks:
- id: shellcheck
1 change: 0 additions & 1 deletion docs/thanks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@ Projects
- `Readthedocs <https://readthedocs.org>`__
- `mypy <https://mypy.readthedocs.io>`__
- `ruff <https://github.com/charliermarsh/ruff>`__
- `Flake8 <https://flake8.pycqa.org>`__
- `pre-commit <https://pre-commit.com>`__
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ show_column_numbers = true
pretty = true

[tool.ruff]
# https://github.com/charliermarsh/ruff#configuration
preview = true
ignore = ["E501"] # line too long
line-length = 121
# https://beta.ruff.rs/docs/rules/
extend-select = [
"A",
Expand Down Expand Up @@ -95,6 +94,11 @@ extend-select = [
force-single-line = true
lines-after-imports = 2

# TODO: Replace black config below with the following once we can pick up the fix for
# https://github.com/astral-sh/ruff/issues/8357 and switch from black to ruff:
# [tool.ruff.format]
# quote-style = "single"

[tool.black]
line-length = 121
preview = true
Expand Down

0 comments on commit ea8b0c6

Please sign in to comment.