diff --git a/crates/ty/docs/configuration.md b/crates/ty/docs/configuration.md index a2986eeb27..2b2f4a7282 100644 --- a/crates/ty/docs/configuration.md +++ b/crates/ty/docs/configuration.md @@ -76,6 +76,7 @@ python = "./.venv" Specifies the target platform that will be used to analyze the source code. If specified, ty will understand conditions based on comparisons with `sys.platform`, such as are commonly found in typeshed to reflect the differing contents of the standard library across platforms. +If `all` is specified, ty will assume that the source code can run on any platform. If no platform is specified, ty will use the current platform: - `win32` for Windows @@ -86,7 +87,7 @@ If no platform is specified, ty will use the current platform: **Default value**: `` -**Type**: `"win32" | "darwin" | "android" | "ios" | "linux" | str` +**Type**: `"win32" | "darwin" | "android" | "ios" | "linux" | "all" | str` **Example usage** (`pyproject.toml`): diff --git a/crates/ty_project/src/metadata/options.rs b/crates/ty_project/src/metadata/options.rs index 11dd846d58..44324209a1 100644 --- a/crates/ty_project/src/metadata/options.rs +++ b/crates/ty_project/src/metadata/options.rs @@ -333,6 +333,7 @@ pub struct EnvironmentOptions { /// Specifies the target platform that will be used to analyze the source code. /// If specified, ty will understand conditions based on comparisons with `sys.platform`, such /// as are commonly found in typeshed to reflect the differing contents of the standard library across platforms. + /// If `all` is specified, ty will assume that the source code can run on any platform. /// /// If no platform is specified, ty will use the current platform: /// - `win32` for Windows @@ -343,7 +344,7 @@ pub struct EnvironmentOptions { #[serde(skip_serializing_if = "Option::is_none")] #[option( default = r#""#, - value_type = r#""win32" | "darwin" | "android" | "ios" | "linux" | str"#, + value_type = r#""win32" | "darwin" | "android" | "ios" | "linux" | "all" | str"#, example = r#" # Tailor type stubs and conditionalized type definitions to windows. python-platform = "win32" diff --git a/ty.schema.json b/ty.schema.json index f4ae8d241b..2864a67963 100644 --- a/ty.schema.json +++ b/ty.schema.json @@ -88,7 +88,7 @@ ] }, "python-platform": { - "description": "Specifies the target platform that will be used to analyze the source code. If specified, ty will understand conditions based on comparisons with `sys.platform`, such as are commonly found in typeshed to reflect the differing contents of the standard library across platforms.\n\nIf no platform is specified, ty will use the current platform: - `win32` for Windows - `darwin` for macOS - `android` for Android - `ios` for iOS - `linux` for everything else", + "description": "Specifies the target platform that will be used to analyze the source code. If specified, ty will understand conditions based on comparisons with `sys.platform`, such as are commonly found in typeshed to reflect the differing contents of the standard library across platforms. If `all` is specified, ty will assume that the source code can run on any platform.\n\nIf no platform is specified, ty will use the current platform: - `win32` for Windows - `darwin` for macOS - `android` for Android - `ios` for iOS - `linux` for everything else", "anyOf": [ { "$ref": "#/definitions/PythonPlatform"