Skip to content

Commit

Permalink
lint: switch Black with ruff-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Borda committed Mar 11, 2024
1 parent edb8d26 commit 517f83a
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 27 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@ jobs:
- uses: pre-commit/action@v3.0.1
with:
extra_args: --all-files --hook-stage manual
env:
SKIP: black-format
18 changes: 2 additions & 16 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,10 @@
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 23.9.1
hooks:
- id: black
alias: black-check
name: black (check)
args: [--check, --diff]
exclude: ^git/ext/
stages: [manual]

- id: black
alias: black-format
name: black (format)
exclude: ^git/ext/

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.0
hooks:
#- id: ruff-format # todo: eventually replace Black with Ruff for consistency
# args: ["--preview"]
- id: ruff-format
exclude: ^git/ext/
- id: ruff
args: ["--fix"]
exclude: ^doc|^git/ext/
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ all:
@awk -F: '/^[[:alpha:]].*:/ && !/^all:/ {print $$1}' Makefile

lint:
SKIP=black-format pre-commit run --all-files --hook-stage manual
SKIP=pre-commit run --all-files --hook-stage manual

clean:
rm -rf build/ dist/ .eggs/ .tox/
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ source = ["git"]
include = ["*/git/*"]
omit = ["*/git/ext/*"]

[tool.black]
line-length = 120
target-version = ["py37"]
extend-exclude = "git/ext/gitdb"

[tool.ruff]
target-version = "py37"
line-length = 120
Expand Down
1 change: 0 additions & 1 deletion test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
black
coverage[toml]
ddt >= 1.1.1, != 1.4.3
mock ; python_version < "3.8"
Expand Down
2 changes: 0 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ commands = pytest --color=yes {posargs}
[testenv:lint]
description = Lint via pre-commit
base_python = py{39,310,311,312,38,37}
set_env =
SKIP = black-format
commands = pre-commit run --all-files --hook-stage manual

[testenv:mypy]
Expand Down

0 comments on commit 517f83a

Please sign in to comment.