Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: remove . from check and format commands #10217

Merged
merged 5 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/formatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ The Ruff formatter is available as of Ruff [v0.1.2](https://astral.sh/blog/the-r
directories, and formats all discovered Python files:

```shell
ruff format . # Format all files in the current directory.
ruff format # Format all files in the current directory.
hoel-bagard marked this conversation as resolved.
Show resolved Hide resolved
ruff format /path/to/file.py # Format a single file.
```

Expand Down Expand Up @@ -423,7 +423,7 @@ call the Ruff linter and then the formatter:

```shell
ruff check --select I --fix .
ruff format .
ruff format
```

A unified command for both linting and formatting is [planned](https://github.com/astral-sh/ruff/issues/8232).
8 changes: 4 additions & 4 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ 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.
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)
Expand Down Expand Up @@ -58,8 +58,8 @@ On **Docker**, it is published as `ghcr.io/astral-sh/ruff`, tagged for each rele
the latest release.

```shell
docker run -v .:/io --rm ghcr.io/astral-sh/ruff check .
docker run -v .:/io --rm ghcr.io/astral-sh/ruff:0.1.3 check .
docker run -v .:/io --rm ghcr.io/astral-sh/ruff check
docker run -v .:/io --rm ghcr.io/astral-sh/ruff:0.1.3 check
```

[![Packaging status](https://repology.org/badge/vertical-allrepos/ruff-python-linter.svg?exclude_unsupported=1)](https://repology.org/project/ruff-python-linter/versions)
12 changes: 6 additions & 6 deletions docs/linter.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ and more.
directories, and lints all discovered Python files, optionally fixing any fixable errors:

```shell
ruff check . # Lint all files in the current directory.
ruff check . --fix # Lint all files in the current directory, and fix any fixable errors.
ruff check . --watch # Lint all files in the current directory, and re-lint on change.
ruff check # Lint all files in the current directory.
ruff check --fix # Lint all files in the current directory, and fix any fixable errors.
ruff check --watch # Lint all files in the current directory, and re-lint on change.
```

For the full list of supported options, run `ruff check --help`.
Expand Down Expand Up @@ -150,7 +150,7 @@ imports, reformat docstrings, rewrite type annotations to use newer Python synta
To enable fixes, pass the `--fix` flag to `ruff check`:

```shell
ruff check . --fix
ruff check --fix
```

By default, Ruff will fix all violations for which safe fixes are available; to determine
Expand Down Expand Up @@ -197,10 +197,10 @@ Ruff only enables safe fixes by default. Unsafe fixes can be enabled by settings

```shell
# Show unsafe fixes
ruff check . --unsafe-fixes
ruff check --unsafe-fixes

# Apply unsafe fixes
ruff check . --fix --unsafe-fixes
ruff check --fix --unsafe-fixes
```

By default, Ruff will display a hint when unsafe fixes are available but not enabled. The suggestion can be silenced
Expand Down
12 changes: 6 additions & 6 deletions docs/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def sum_even_numbers(numbers: Iterable[int]) -> int:
We can run the Ruff linter over our project via `ruff check`:

```shell
❯ ruff check .
❯ ruff check
numbers/numbers.py:3:8: F401 [*] `os` imported but unused
Found 1 error.
[*] 1 fixable with the `--fix` option.
Expand Down Expand Up @@ -74,7 +74,7 @@ def sum_even_numbers(numbers: Iterable[int]) -> int:
Now that our project is passing `ruff check`, we can run the Ruff formatter via `ruff format`:

```shell
❯ ruff format .
❯ ruff format
1 file reformatted
```

Expand Down Expand Up @@ -135,7 +135,7 @@ To configure Ruff, let's create a configuration file in our project's root direc
Running Ruff again, we see that it now enforces a maximum line width, with a limit of 79:

```shell
❯ ruff check .
❯ ruff check
numbers/numbers.py:5:80: E501 Line too long (90 > 79)
Found 1 error.
```
Expand Down Expand Up @@ -217,7 +217,7 @@ If we run Ruff again, we'll see that it now enforces the pyupgrade rules. In par
the use of the deprecated `typing.Iterable` instead of `collections.abc.Iterable`:

```shell
❯ ruff check .
❯ ruff check
numbers/numbers.py:1:1: UP035 [*] Import from `collections.abc` instead: `Iterable`
Found 1 error.
[*] 1 fixable with the `--fix` option.
Expand Down Expand Up @@ -260,7 +260,7 @@ all functions have docstrings:
If we run Ruff again, we'll see that it now enforces the pydocstyle rules:

```shell
❯ ruff check .
❯ ruff check
numbers/__init__.py:1:1: D104 Missing docstring in public package
numbers/numbers.py:1:1: UP035 [*] Import from `collections.abc` instead: `Iterable`
numbers/numbers.py:1:1: D100 Missing docstring in public module
Expand All @@ -285,7 +285,7 @@ def sum_even_numbers(numbers: Iterable[int]) -> int:
Running `ruff check` again, we'll see that it no longer flags the `Iterable` import:

```shell
❯ ruff check .
❯ ruff check
numbers/__init__.py:1:1: D104 Missing docstring in public package
numbers/numbers.py:1:1: D100 Missing docstring in public module
Found 3 errors.
Expand Down
Loading