diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index a6852951..dd4d67ad 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -122,6 +122,7 @@ Before you push It's a good idea to run ``just full-check`` before getting a review. This will run linters, docs build and tests under every supported Python version. +You can automatically fix many lint errors using ``just autofix`` (or ``just autofix-python`` and ``just autofix-rust`` separately). Benchmarking ============ diff --git a/justfile b/justfile index bc2b6602..ae850085 100644 --- a/justfile +++ b/justfile @@ -77,7 +77,7 @@ lint-python: @echo 'Running Import Linter...' @uv run lint-imports -# Lint Rust code using cargo fmt and clippy +# Lint Rust code using cargo fmt and clippy. [working-directory: 'rust'] [group('linting')] lint-rust: @@ -89,11 +89,19 @@ lint-rust: [group('linting')] autofix-rust: @cargo clippy --all-targets --all-features --fix --allow-staged --allow-dirty + @just format-rust -# Fix any ruff errors +# Fix any ruff errors. [group('linting')] autofix-python: @uv run ruff check --fix + @just format-python + +# Fix any lint errors. +[group('linting')] +autofix: + @just autofix-rust + @just autofix-python # Run linters. [group('linting')]