Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Nov 6, 2023
1 parent 10f65f8 commit 231aff0
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -357,16 +357,23 @@ If your `pyproject.toml`, `ruff.toml`, or `.ruff.toml` extends another configura
will still use the directory containing your `pyproject.toml`, `ruff.toml`, or `.ruff.toml` file as
the project root (as opposed to the directory of the file pointed to via the `extends` option).

For example, if you add a `ruff.toml` to the `tests` directory in the above example, you'll want to
explicitly set the `src` option in the extended configuration file:
For example, if you add a configuration file to the `tests` directory in the above example, you'll
want to explicitly set the `src` option in the extended configuration file:

=== "pyproject.toml"

```toml
[tool.ruff]
extend = "../pyproject.toml"
src = ["../src"]
```

=== "ruff.toml"

```toml
# tests/ruff.toml
extend = "../pyproject.toml"
src = ["../src"]
```
```toml
extend = "../pyproject.toml"
src = ["../src"]
```

Beyond this `src`-based detection, Ruff will also attempt to determine the current Python package
for a given Python file, and mark imports from within the same package as first-party. For example,
Expand Down Expand Up @@ -484,7 +491,7 @@ Run `ruff check /path/to/code.py --show-settings` to view the resolved settings

## I want to use Ruff, but I don't want to use `pyproject.toml`. What are my options?

Yes! In lieu of a `pyproject.toml` file, you can use a `ruff.toml` file for configuration. The two
In lieu of a `pyproject.toml` file, you can use a `ruff.toml` file for configuration. The two
files are functionally equivalent and have an identical schema, with the exception that a `ruff.toml`
file can omit the `[tool.ruff]` section header. For example:

Expand Down

0 comments on commit 231aff0

Please sign in to comment.