Skip to content

Commit 625b4f5

Browse files
authored
[ruff] docs: Clarify first-party import detection in Ruff (#23591)
1 parent 60facfa commit 625b4f5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

docs/faq.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,8 @@ want to explicitly set the `src` option in the extended configuration file:
383383
```
384384

385385
Beyond this `src`-based detection, Ruff will also attempt to determine the current Python package
386-
for a given Python file, and mark imports from within the same package as first-party. For example,
386+
for a given Python file (determined via the existence of a `__init__.py` file in a directory),
387+
and mark imports from within the same package as first-party. For example,
387388
above, `baz.py` would be identified as part of the Python package beginning at
388389
`./my_project/src/foo`, and so any imports in `baz.py` that begin with `foo` (like `import foo.bar`)
389390
would be considered first-party based on this same-package heuristic.

0 commit comments

Comments
 (0)