diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 97542c8cc3..2f070ad085 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2b3a973763..5fe9421442 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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 diff --git a/Makefile b/Makefile index 2b3705974a..4ad2afb585 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 8f8ac2bb44..027811d436 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -134,7 +134,6 @@ all = [ [dependency-groups] dev = [ - "black==24.10.0", "coverage[toml]>=7", "pre-commit>=4", "pytest>=8", @@ -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