Skip to content

Commit

Permalink
use ruff format
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent committed Dec 1, 2024
1 parent a01113e commit a6d7b41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,11 @@ repos:
- id: debug-statements
- id: check-docstring-first

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

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.0
hooks:
- id: ruff
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
Expand Down
28 changes: 15 additions & 13 deletions bin/website
Original file line number Diff line number Diff line change
Expand Up @@ -174,19 +174,21 @@ class DocsPullCommand(ConfigureCommand):
with temporary_directory() as tmp_dir:
os.chdir(tmp_dir)
tmp_dir = Path(tmp_dir)
subprocess.run([
"git",
"clone",
"--single-branch",
"--branch",
version,
"--depth",
"1",
"--filter=blob:none",
"--sparse",
self.REPOSITORY,
".",
])
subprocess.run(
[
"git",
"clone",
"--single-branch",
"--branch",
version,
"--depth",
"1",
"--filter=blob:none",
"--sparse",
self.REPOSITORY,
".",
]
)
subprocess.run(["git", "sparse-checkout", "init", "--cone"])
subprocess.run(["git", "sparse-checkout", "set", "docs"])

Expand Down
18 changes: 8 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@ pre-commit = ">=2.13.0"

[tool.ruff]
fix = true
unfixable = [
"ERA", # do not autoremove commented out code
]
target-version = "py310"
line-length = 88
target-version = "py310"

[tool.ruff.lint]
extend-select = [
"B", # flake8-bugbear
"C4", # flake8-comprehensions
Expand All @@ -36,20 +35,19 @@ extend-select = [
"TID", # flake8-tidy-imports
"UP", # pyupgrade
]
unfixable = [
"ERA", # do not autoremove commented out code
]

[tool.ruff.flake8-tidy-imports]
[tool.ruff.lint.flake8-tidy-imports]
ban-relative-imports = "all"

[tool.ruff.isort]
[tool.ruff.lint.isort]
force-single-line = true
lines-between-types = 1
lines-after-imports = 2
required-imports = ["from __future__ import annotations"]

[tool.black]
target-version = ["py310"]
preview = true

[tool.website.config]
baseURL = "https://python-poetry.org/"
languageCode = "en-us"
Expand Down

0 comments on commit a6d7b41

Please sign in to comment.