mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-19 10:01:15 +00:00
fix casing of analyze.direction
variant names (#18892)
## Summary Fixes `analyze.direction` to use kebab-case for the variant names. Fixes https://github.com/astral-sh/ruff/issues/18887 ## Test Plan Created a `ruff.toml` and tested that both `dependents` and `Dependents` were accepted
This commit is contained in:
parent
291413b126
commit
b64307f65e
2 changed files with 9 additions and 3 deletions
|
@ -36,14 +36,20 @@ impl fmt::Display for AnalyzeSettings {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, CacheKey)]
|
#[derive(Default, Debug, Copy, Clone, PartialEq, Eq, CacheKey)]
|
||||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
#[cfg_attr(
|
||||||
|
feature = "serde",
|
||||||
|
derive(serde::Serialize, serde::Deserialize),
|
||||||
|
serde(rename_all = "kebab-case")
|
||||||
|
)]
|
||||||
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
#[cfg_attr(feature = "schemars", derive(schemars::JsonSchema))]
|
||||||
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
#[cfg_attr(feature = "clap", derive(clap::ValueEnum))]
|
||||||
pub enum Direction {
|
pub enum Direction {
|
||||||
/// Construct a map from module to its dependencies (i.e., the modules that it imports).
|
/// Construct a map from module to its dependencies (i.e., the modules that it imports).
|
||||||
#[default]
|
#[default]
|
||||||
|
#[cfg_attr(feature = "serde", serde(alias = "Dependencies"))]
|
||||||
Dependencies,
|
Dependencies,
|
||||||
/// Construct a map from module to its dependents (i.e., the modules that import it).
|
/// Construct a map from module to its dependents (i.e., the modules that import it).
|
||||||
|
#[cfg_attr(feature = "serde", serde(alias = "Dependents"))]
|
||||||
Dependents,
|
Dependents,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
4
ruff.schema.json
generated
4
ruff.schema.json
generated
|
@ -873,14 +873,14 @@
|
||||||
"description": "Construct a map from module to its dependencies (i.e., the modules that it imports).",
|
"description": "Construct a map from module to its dependencies (i.e., the modules that it imports).",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"Dependencies"
|
"dependencies"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"description": "Construct a map from module to its dependents (i.e., the modules that import it).",
|
"description": "Construct a map from module to its dependents (i.e., the modules that import it).",
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"enum": [
|
"enum": [
|
||||||
"Dependents"
|
"dependents"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue