Skip to content

Commit 00ee16e

Browse files
committed
Use uv
1 parent d45c1ee commit 00ee16e

File tree

5 files changed

+60
-42
lines changed

5 files changed

+60
-42
lines changed

README.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -118,30 +118,30 @@ For more, see the [documentation](https://docs.astral.sh/ruff/).
118118

119119
Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI:
120120

121-
```shell
122-
# With uv.
123-
uv add --dev ruff # to add ruff to your project
124-
uv tool install ruff # to install ruff globally
121+
```console
122+
$ # With uv.
123+
$ uv tool install ruff # Install Ruff globally.
124+
$ uv add --dev ruff # Or add Ruff to your project.
125125

126-
# With pip.
127-
pip install ruff
126+
$ # With pip.
127+
$ pip install ruff
128128

129-
# With pipx.
130-
pipx install ruff
129+
$ # With pipx.
130+
$ pipx install ruff
131131
```
132132

133133
Starting with version `0.5.0`, Ruff can be installed with our standalone installers:
134134

135-
```shell
136-
# On macOS and Linux.
137-
curl -LsSf https://astral.sh/ruff/install.sh | sh
135+
```console
136+
$ # On macOS and Linux.
137+
$ curl -LsSf https://astral.sh/ruff/install.sh | sh
138138

139-
# On Windows.
140-
powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
139+
$ # On Windows.
140+
$ powershell -c "irm https://astral.sh/ruff/install.ps1 | iex"
141141

142-
# For a specific version.
143-
curl -LsSf https://astral.sh/ruff/0.8.6/install.sh | sh
144-
powershell -c "irm https://astral.sh/ruff/0.8.6/install.ps1 | iex"
142+
$ # For a specific version.
143+
$ curl -LsSf https://astral.sh/ruff/0.8.6/install.sh | sh
144+
$ powershell -c "irm https://astral.sh/ruff/0.8.6/install.ps1 | iex"
145145
```
146146

147147
You can also install Ruff via [Homebrew](https://formulae.brew.sh/formula/ruff), [Conda](https://anaconda.org/conda-forge/ruff),
@@ -151,22 +151,22 @@ and with [a variety of other package managers](https://docs.astral.sh/ruff/insta
151151

152152
To run Ruff as a linter, try any of the following:
153153

154-
```shell
155-
ruff check # Lint all files in the current directory (and any subdirectories).
156-
ruff check path/to/code/ # Lint all files in `/path/to/code` (and any subdirectories).
157-
ruff check path/to/code/*.py # Lint all `.py` files in `/path/to/code`.
158-
ruff check path/to/code/to/file.py # Lint `file.py`.
159-
ruff check @arguments.txt # Lint using an input file, treating its contents as newline-delimited command-line arguments.
154+
```console
155+
$ ruff check # Lint all files in the current directory (and any subdirectories).
156+
$ ruff check path/to/code/ # Lint all files in `/path/to/code` (and any subdirectories).
157+
$ ruff check path/to/code/*.py # Lint all `.py` files in `/path/to/code`.
158+
$ ruff check path/to/code/to/file.py # Lint `file.py`.
159+
$ ruff check @arguments.txt # Lint using an input file, treating its contents as newline-delimited command-line arguments.
160160
```
161161

162162
Or, to run Ruff as a formatter:
163163

164-
```shell
165-
ruff format # Format all files in the current directory (and any subdirectories).
166-
ruff format path/to/code/ # Format all files in `/path/to/code` (and any subdirectories).
167-
ruff format path/to/code/*.py # Format all `.py` files in `/path/to/code`.
168-
ruff format path/to/code/to/file.py # Format `file.py`.
169-
ruff format @arguments.txt # Format using an input file, treating its contents as newline-delimited command-line arguments.
164+
```console
165+
$ ruff format # Format all files in the current directory (and any subdirectories).
166+
$ ruff format path/to/code/ # Format all files in `/path/to/code` (and any subdirectories).
167+
$ ruff format path/to/code/*.py # Format all `.py` files in `/path/to/code`.
168+
$ ruff format path/to/code/to/file.py # Format `file.py`.
169+
$ ruff format @arguments.txt # Format using an input file, treating its contents as newline-delimited command-line arguments.
170170
```
171171

172172
Ruff can also be used as a [pre-commit](https://pre-commit.com/) hook via [`ruff-pre-commit`](https://github.com/astral-sh/ruff-pre-commit):
@@ -277,14 +277,14 @@ example, `[lint]` should be replaced with `[tool.ruff.lint]`.
277277
Some configuration options can be provided via dedicated command-line arguments, such as those
278278
related to rule enablement and disablement, file discovery, and logging level:
279279

280-
```shell
281-
ruff check --select F401 --select F403 --quiet
280+
```console
281+
$ ruff check --select F401 --select F403 --quiet
282282
```
283283

284284
The remaining configuration options can be provided through a catch-all `--config` argument:
285285

286-
```shell
287-
ruff check --config "lint.per-file-ignores = {'some_file.py' = ['F841']}"
286+
```console
287+
$ ruff check --config "lint.per-file-ignores = {'some_file.py' = ['F841']}"
288288
```
289289

290290
To opt in to the latest lint rules, formatter style changes, interface updates, and more, enable

docs/faq.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -220,15 +220,18 @@ Ruff is installable under any Python version from 3.7 onwards.
220220

221221
## Do I need to install Rust to use Ruff?
222222

223-
Nope! Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI:
223+
Nope! Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI. We recommend installing Ruff with [uv](https://docs.astral.sh/uv/):
224224

225225
```console
226-
# With uv.
227-
$ uv add --dev ruff # to add ruff to your project
228-
$ uv tool install ruff # to install ruff globally
226+
$ # With uv.
227+
$ uv tool install ruff # Install Ruff globally.
228+
$ uv add --dev ruff # Or add Ruff to your project.
229229

230-
# With pip
230+
$ # With pip.
231231
$ pip install ruff
232+
233+
$ # With pipx.
234+
$ pipx install ruff
232235
```
233236

234237
Ruff ships with wheels for all major platforms, which enables `pip` to install Ruff without relying

docs/installation.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
# Installing Ruff
22

3-
Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI:
3+
Ruff is available as [`ruff`](https://pypi.org/project/ruff/) on PyPI. We recommend installing Ruff with [uv](https://docs.astral.sh/uv/):
44

55
```console
6+
$ # With uv.
7+
$ uv tool install ruff
8+
9+
$ # With pip.
610
$ pip install ruff
11+
12+
$ # With pipx.
13+
$ pipx install ruff
714
```
815

916
Once installed, you can run Ruff from the command line:
@@ -13,7 +20,7 @@ $ ruff check # Lint all files in the current directory.
1320
$ ruff format # Format all files in the current directory.
1421
```
1522

16-
Starting with version `0.5.0`, Ruff can be installed with our standalone installers:
23+
Starting with version `0.5.0`, Ruff can also be installed with our standalone installers:
1724

1825
```console
1926
$ # On macOS and Linux.

docs/tutorial.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,18 @@ your project. For a more detailed overview, see [_Configuring Ruff_](configurati
55

66
## Getting Started
77

8-
To start, we'll install Ruff through PyPI (or with your [preferred package manager](installation.md)):
8+
To start, we'll install Ruff from PyPI. You can install Ruff with [uv](https://docs.astral.sh/uv/), or
9+
your [preferred package manager](installation.md):
910

1011
```console
12+
$ # With uv.
13+
$ uv tool install ruff
14+
15+
$ # With pip.
1116
$ pip install ruff
17+
18+
$ # With pipx.
19+
$ pipx install ruff
1220
```
1321

1422
Let's then assume that our project structure looks like:

python/ruff-ecosystem/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Compare lint and format results for two different ruff versions (e.g. main and a
44

55
## Installation
66

7-
From the Ruff project root, install with `pip`:
7+
From the Ruff project root, install with [uv](https://docs.astral.sh/uv/):
88

99
```shell
10-
pip install -e ./python/ruff-ecosystem
10+
uv tool install -e ./python/ruff-ecosystem
1111
```
1212

1313
## Usage

0 commit comments

Comments
 (0)