mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
## Summary
This PR updates our documentation for the upcoming formatter release.
Broadly, the documentation is now structured as follows:
- Overview
- Tutorial
- Installing Ruff
- The Ruff Linter
- Overview
- `ruff check`
- Rule selection
- Error suppression
- Exit codes
- The Ruff Formatter
- Overview
- `ruff format`
- Philosophy
- Configuration
- Format suppression
- Exit codes
- Black compatibility
- Known deviations
- Configuring Ruff
- pyproject.toml
- File discovery
- Configuration discovery
- CLI
- Shell autocompletion
- Preview
- Rules
- Settings
- Integrations
- `pre-commit`
- VS Code
- LSP
- PyCharm
- GitHub Actions
- FAQ
- Contributing
The major changes include:
- Removing the "Usage" section from the docs, and instead folding that
information into "Integrations" and the new Linter and Formatter
sections.
- Breaking up "Configuration" into "Configuring Ruff" (for generic
configuration), and new Linter- and Formatter-specific sections.
- Updating all example configurations to use `[tool.ruff.lint]` and
`[tool.ruff.format]`.
My suggestion is to pull and build the docs locally, and review by
reading them in the browser rather than trying to parse all the code
changes.
Closes https://github.com/astral-sh/ruff/issues/7235.
Closes https://github.com/astral-sh/ruff/issues/7647.
77 lines
1.8 KiB
YAML
77 lines
1.8 KiB
YAML
fail_fast: true
|
|
|
|
exclude: |
|
|
(?x)^(
|
|
crates/ruff_linter/resources/.*|
|
|
crates/ruff_linter/src/rules/.*/snapshots/.*|
|
|
crates/ruff_cli/resources/.*|
|
|
crates/ruff_python_formatter/resources/.*|
|
|
crates/ruff_python_formatter/tests/snapshots/.*|
|
|
crates/ruff_python_resolver/resources/.*|
|
|
crates/ruff_python_resolver/tests/snapshots/.*
|
|
)$
|
|
|
|
repos:
|
|
- repo: https://github.com/abravalheri/validate-pyproject
|
|
rev: v0.12.1
|
|
hooks:
|
|
- id: validate-pyproject
|
|
|
|
- repo: https://github.com/executablebooks/mdformat
|
|
rev: 0.7.16
|
|
hooks:
|
|
- id: mdformat
|
|
additional_dependencies:
|
|
- mdformat-mkdocs
|
|
- mdformat-admon
|
|
exclude: |
|
|
(?x)^(
|
|
docs/formatter/black.md
|
|
)$
|
|
|
|
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
rev: v0.33.0
|
|
hooks:
|
|
- id: markdownlint-fix
|
|
|
|
- repo: https://github.com/crate-ci/typos
|
|
rev: v1.14.12
|
|
hooks:
|
|
- id: typos
|
|
|
|
- repo: local
|
|
hooks:
|
|
- id: cargo-fmt
|
|
name: cargo fmt
|
|
entry: cargo fmt --
|
|
language: system
|
|
types: [rust]
|
|
pass_filenames: false # This makes it a lot faster
|
|
- id: ruff
|
|
name: ruff
|
|
entry: cargo run --bin ruff -- check --no-cache --force-exclude --fix --exit-non-zero-on-fix
|
|
language: system
|
|
types_or: [python, pyi]
|
|
require_serial: true
|
|
exclude: |
|
|
(?x)^(
|
|
crates/ruff_linter/resources/.*|
|
|
crates/ruff_python_formatter/resources/.*
|
|
)$
|
|
|
|
# Black
|
|
- repo: https://github.com/psf/black
|
|
rev: 23.1.0
|
|
hooks:
|
|
- id: black
|
|
|
|
# Prettier
|
|
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
rev: v3.0.0
|
|
hooks:
|
|
- id: prettier
|
|
types: [yaml]
|
|
|
|
ci:
|
|
skip: [cargo-fmt, dev-generate-all]
|