Commit 65486660 by Bartosz Sokorski Committed by GitHub

Expand ruff usage (#7850)

parent 9e5dd98d
...@@ -20,43 +20,6 @@ repos: ...@@ -20,43 +20,6 @@ repos:
- id: debug-statements - id: debug-statements
- id: check-docstring-first - id: check-docstring-first
- repo: https://github.com/pre-commit/pygrep-hooks
rev: v1.10.0
hooks:
- id: python-check-mock-methods
- id: python-use-type-annotations
- id: python-check-blanket-noqa
- repo: https://github.com/asottile/pyupgrade
rev: v3.3.2
hooks:
- id: pyupgrade
args: [--py37-plus]
exclude: ^install-poetry.py$
- repo: https://github.com/hadialqattan/pycln
rev: v2.1.3
hooks:
- id: pycln
args: [--all]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: "isort (python)"
types: [python]
args: [--add-import, from __future__ import annotations]
exclude: |
(?x)(
^install-poetry.py$
| ^src/poetry/__init__.py$
)
- id: isort
name: "isort (pyi)"
types: [pyi]
args: [--lines-after-imports, "-1"]
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 23.3.0 rev: 23.3.0
hooks: hooks:
......
...@@ -134,6 +134,9 @@ extend-select = [ ...@@ -134,6 +134,9 @@ extend-select = [
"TCH", # flake8-type-checking "TCH", # flake8-type-checking
"N", # pep8-naming "N", # pep8-naming
"RUF", # ruff checks "RUF", # ruff checks
"UP", # pyupgrade
"I", # isort
"PGH", # pygrep
] ]
ignore = [ ignore = [
"B904", # use 'raise ... from err' "B904", # use 'raise ... from err'
...@@ -151,17 +154,13 @@ extend-exclude = [ ...@@ -151,17 +154,13 @@ extend-exclude = [
[tool.ruff.flake8-tidy-imports] [tool.ruff.flake8-tidy-imports]
ban-relative-imports = "all" ban-relative-imports = "all"
[tool.ruff.isort]
[tool.isort] force-single-line = true
py_version = 37 lines-between-types = 1
profile = "black" lines-after-imports = 2
force_single_line = true known-first-party = ["poetry"]
combine_as_imports = true known-third-party = ["poetry.core"]
lines_between_types = 1 required-imports = ["from __future__ import annotations"]
lines_after_imports = 2
src_paths = ["src", "tests"]
extend_skip = ["setup.py"]
known_third_party = ["poetry.core"]
[tool.black] [tool.black]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment