Skip to content

Commit

Permalink
build: switch black to ruff formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
eginhard committed Jan 11, 2025
1 parent 1c9c00e commit 124d077
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 13 deletions.
6 changes: 1 addition & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: "https://github.com/psf/black"
rev: 24.10.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
- id: ruff-format
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ curl -LsSf https://astral.sh/uv/install.sh | sh
uv run make test_all # run all the tests, report all the errors
```

9. Format your code. We use ```black``` for code formatting.
9. Format your code. We use ```ruff``` for code formatting.

```bash
make style
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ test_failed: ## only run tests failed the last time.
coverage run -m pytest -x -v --last-failed tests

style: ## update code style.
uv run --only-dev black ${target_dirs}
uv run --only-dev ruff format ${target_dirs}

lint: ## run linters.
uv run --only-dev ruff check ${target_dirs}
uv run --only-dev black ${target_dirs} --check
uv run --only-dev ruff format ${target_dirs} --check

system-deps: ## install linux system deps
sudo apt-get install -y libsndfile1-dev
Expand Down
5 changes: 0 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ all = [

[dependency-groups]
dev = [
"black==24.10.0",
"coverage[toml]>=7",
"pre-commit>=4",
"pytest>=8",
Expand Down Expand Up @@ -232,10 +231,6 @@ max-returns = 7
"E402", # module level import not at top of file
]

[tool.black]
line-length = 120
target-version = ['py310']

[tool.coverage.report]
skip_covered = true
skip_empty = true
Expand Down

0 comments on commit 124d077

Please sign in to comment.