From ca5f0994813404d6c1278d2f3f636c0ef5ee4b7b Mon Sep 17 00:00:00 2001 From: Aria Desires Date: Fri, 12 Dec 2025 16:30:23 -0500 Subject: [PATCH] [ty] update implicit root docs (#21955) ## Summary ./tests is now no longer an implicit root, per https://github.com/astral-sh/ruff/pull/21817 --- crates/ty/docs/configuration.md | 4 ++-- crates/ty_project/src/metadata/options.rs | 4 ++-- ty.schema.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/ty/docs/configuration.md b/crates/ty/docs/configuration.md index 4ecf8f8399..0768f1b26a 100644 --- a/crates/ty/docs/configuration.md +++ b/crates/ty/docs/configuration.md @@ -158,7 +158,7 @@ If left unspecified, ty will try to detect common project layouts and initialize * if a `.//` directory exists, include `.` and `./` in the first party search path * otherwise, default to `.` (flat layout) -Besides, if a `./python` or `./tests` directory exists and is not a package (i.e. it does not contain an `__init__.py` or `__init__.pyi` file), +Additionally, if a `./python` directory exists and is not a package (i.e. it does not contain an `__init__.py` or `__init__.pyi` file), it will also be included in the first party search path. **Default value**: `null` @@ -443,7 +443,7 @@ If left unspecified, ty will try to detect common project layouts and initialize * if a `.//` directory exists, include `.` and `./` in the first party search path * otherwise, default to `.` (flat layout) -Besides, if a `./tests` directory exists and is not a package (i.e. it does not contain an `__init__.py` file), +Additionally, if a `./python` directory exists and is not a package (i.e. it does not contain an `__init__.py` file), it will also be included in the first party search path. **Default value**: `null` diff --git a/crates/ty_project/src/metadata/options.rs b/crates/ty_project/src/metadata/options.rs index ae5b1b44c3..df667ed049 100644 --- a/crates/ty_project/src/metadata/options.rs +++ b/crates/ty_project/src/metadata/options.rs @@ -516,7 +516,7 @@ pub struct EnvironmentOptions { /// * if a `.//` directory exists, include `.` and `./` in the first party search path /// * otherwise, default to `.` (flat layout) /// - /// Besides, if a `./python` or `./tests` directory exists and is not a package (i.e. it does not contain an `__init__.py` or `__init__.pyi` file), + /// Additionally, if a `./python` directory exists and is not a package (i.e. it does not contain an `__init__.py` or `__init__.pyi` file), /// it will also be included in the first party search path. #[serde(skip_serializing_if = "Option::is_none")] #[option( @@ -658,7 +658,7 @@ pub struct SrcOptions { /// * if a `.//` directory exists, include `.` and `./` in the first party search path /// * otherwise, default to `.` (flat layout) /// - /// Besides, if a `./tests` directory exists and is not a package (i.e. it does not contain an `__init__.py` file), + /// Additionally, if a `./python` directory exists and is not a package (i.e. it does not contain an `__init__.py` file), /// it will also be included in the first party search path. #[serde(skip_serializing_if = "Option::is_none")] #[option( diff --git a/ty.schema.json b/ty.schema.json index 5630ec353c..13d1ac9c47 100644 --- a/ty.schema.json +++ b/ty.schema.json @@ -112,7 +112,7 @@ ] }, "root": { - "description": "The root paths of the project, used for finding first-party modules.\n\nAccepts a list of directory paths searched in priority order (first has highest priority).\n\nIf left unspecified, ty will try to detect common project layouts and initialize `root` accordingly:\n\n* if a `./src` directory exists, include `.` and `./src` in the first party search path (src layout or flat)\n* if a `.//` directory exists, include `.` and `./` in the first party search path\n* otherwise, default to `.` (flat layout)\n\nBesides, if a `./python` or `./tests` directory exists and is not a package (i.e. it does not contain an `__init__.py` or `__init__.pyi` file),\nit will also be included in the first party search path.", + "description": "The root paths of the project, used for finding first-party modules.\n\nAccepts a list of directory paths searched in priority order (first has highest priority).\n\nIf left unspecified, ty will try to detect common project layouts and initialize `root` accordingly:\n\n* if a `./src` directory exists, include `.` and `./src` in the first party search path (src layout or flat)\n* if a `.//` directory exists, include `.` and `./` in the first party search path\n* otherwise, default to `.` (flat layout)\n\nAdditionally, if a `./python` directory exists and is not a package (i.e. it does not contain an `__init__.py` or `__init__.pyi` file),\nit will also be included in the first party search path.", "type": [ "array", "null" @@ -1171,7 +1171,7 @@ ] }, "root": { - "description": "The root of the project, used for finding first-party modules.\n\nIf left unspecified, ty will try to detect common project layouts and initialize `src.root` accordingly:\n\n* if a `./src` directory exists, include `.` and `./src` in the first party search path (src layout or flat)\n* if a `.//` directory exists, include `.` and `./` in the first party search path\n* otherwise, default to `.` (flat layout)\n\nBesides, if a `./tests` directory exists and is not a package (i.e. it does not contain an `__init__.py` file),\nit will also be included in the first party search path.", + "description": "The root of the project, used for finding first-party modules.\n\nIf left unspecified, ty will try to detect common project layouts and initialize `src.root` accordingly:\n\n* if a `./src` directory exists, include `.` and `./src` in the first party search path (src layout or flat)\n* if a `.//` directory exists, include `.` and `./` in the first party search path\n* otherwise, default to `.` (flat layout)\n\nAdditionally, if a `./python` directory exists and is not a package (i.e. it does not contain an `__init__.py` file),\nit will also be included in the first party search path.", "anyOf": [ { "$ref": "#/definitions/RelativePathBuf"