mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-18 17:41:12 +00:00
[red-knot] Add --python-platform
CLI option (#17284)
## Summary Add a new `--python-platform` command-line option, in analogy to `--python-version`. ## Test Plan Added new integration test.
This commit is contained in:
parent
4a4a376f02
commit
3657f798c9
5 changed files with 87 additions and 7 deletions
|
@ -21,6 +21,15 @@ pub enum PythonPlatform {
|
|||
Identifier(String),
|
||||
}
|
||||
|
||||
impl From<String> for PythonPlatform {
|
||||
fn from(platform: String) -> Self {
|
||||
match platform.as_str() {
|
||||
"all" => PythonPlatform::All,
|
||||
_ => PythonPlatform::Identifier(platform.to_string()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Display for PythonPlatform {
|
||||
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue