mirror of
https://github.com/astral-sh/ruff
synced 2026-01-06 06:04:16 -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.
45 lines
1.1 KiB
Markdown
45 lines
1.1 KiB
Markdown
# Installing Ruff
|
|
|
|
Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI:
|
|
|
|
```shell
|
|
pip install ruff
|
|
```
|
|
|
|
Once installed, you can run Ruff from the command line:
|
|
|
|
```shell
|
|
ruff check . # Lint all files in the current directory.
|
|
ruff format . # Format all files in the current directory.
|
|
```
|
|
|
|
For **macOS Homebrew** and **Linuxbrew** users, Ruff is also available as [`ruff`](https://formulae.brew.sh/formula/ruff)
|
|
on Homebrew:
|
|
|
|
```shell
|
|
brew install ruff
|
|
```
|
|
|
|
For **Conda** users, Ruff is also available as [`ruff`](https://anaconda.org/conda-forge/ruff) on
|
|
`conda-forge`:
|
|
|
|
```shell
|
|
conda install -c conda-forge ruff
|
|
```
|
|
|
|
For **Arch Linux** users, Ruff is also available as [`ruff`](https://archlinux.org/packages/community/x86_64/ruff/)
|
|
on the official repositories:
|
|
|
|
```shell
|
|
pacman -S ruff
|
|
```
|
|
|
|
For **Alpine** users, Ruff is also available as [`ruff`](https://pkgs.alpinelinux.org/package/edge/testing/x86_64/ruff)
|
|
on the testing repositories:
|
|
|
|
```shell
|
|
apk add ruff
|
|
```
|
|
|
|
[](https://repology.org/project/ruff-python-linter/versions)
|