# Ruff
Flake8 + Black + isort 👉 Ruff
[GitHub - astral-sh/ruff: An extremely fast Python linter and code formatter, written in Rust.](https://github.com/astral-sh/ruff)
> An extremely fast Python linter and code formatter, written in Rust.
```sh
pip install ruff
```
```sh
ruff check . # Lint all files in the current directory (and any subdirectories).
ruff check path/to/code/ # Lint all files in `/path/to/code` (and any subdirectories).
ruff check path/to/code/*.py # Lint all `.py` files in `/path/to/code`.
ruff check path/to/code/to/file.py # Lint `file.py`.
ruff check @arguments.txt # Lint using an input file, treating its contents as newline-delimited command-line arguments.
```
```sh
ruff format . # Format all files in the current directory (and any subdirectories).
ruff format path/to/code/ # Format all files in `/path/to/code` (and any subdirectories).
ruff format path/to/code/*.py # Format all `.py` files in `/path/to/code`.
ruff format path/to/code/to/file.py # Format `file.py`.
ruff format @arguments.txt # Format using an input file, treating its contents as newline-delimited command-line arguments.
```
## VSCode
[Ruff - Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=charliermarsh.ruff)
`.vscode/settings.json`
```json
{
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnType": true,
},
"ruff.lint.args": [
"--config=${workspaceFolder}/pyproject.toml",
],
}
```
## Configuration
[[pyproject.toml]]
```toml
[tool.ruff]
# ...
[tool.ruff.lint]
# ...
[tool.ruff.format]
# ...
[tool.ruff.lint.isort]
# ...
```