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 1 commit
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
Next Next commit
docs: 'check .' -> 'check'
  • Loading branch information
hoel-bagard committed Mar 3, 2024
commit e706461c0c94d241d72477be98e0fd2e74cf1371
6 changes: 3 additions & 3 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ pip install ruff
Once installed, you can run Ruff from the command line:

```shell
ruff check . # Lint all files in the current directory.
ruff check # Lint all files in the current directory.
ruff format . # Format all files in the current directory.
```

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
10 changes: 5 additions & 5 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 @@ -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