Docs (`linter.md`): clarify that Python files are always searched for in subdirectories (#15882)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
Alexander Nordin 2025-02-04 07:36:16 -08:00 committed by GitHub
parent 5bf0e2e95e
commit 9d83e76a3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 5 deletions

View File

@ -8,13 +8,15 @@ and more.
## `ruff check`
`ruff check` is the primary entrypoint to the Ruff linter. It accepts a list of files or
directories, and lints all discovered Python files, optionally fixing any fixable errors:
directories, and lints all discovered Python files, optionally fixing any fixable errors.
When linting a directory, Ruff searches for Python files recursively in that directory
and all its subdirectories:
```console
$ 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 path/to/code/ # Lint all files in `path/to/code` (and any subdirectories).
$ ruff check # Lint files in the current directory.
$ ruff check --fix # Lint files in the current directory and fix any fixable errors.
$ ruff check --watch # Lint files in the current directory and re-lint on change.
$ ruff check path/to/code/ # Lint files in `path/to/code`.
```
For the full list of supported options, run `ruff check --help`.