-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Options: Support #[serde(alias = name)]
#8031
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
crates/ruff_workspace/src/options.rs
Outdated
@@ -361,6 +361,7 @@ pub struct Options { | |||
line-length = 120 | |||
"# | |||
)] | |||
#[serde(alias = "line-width", alias = "max-line-length")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is max-line-length
for convenience, or something we once supported?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was a test-only change that I accidentally committed... I reverted the change
a88b7c6
to
9f9d515
Compare
366d2be
to
a583805
Compare
9f9d515
to
408b34e
Compare
a583805
to
f1b00ca
Compare
Signed-off-by: Micha Reiser <micha@reiser.io>
408b34e
to
6ca7407
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
schemars doesn't support aliases. Closing for now |
Summary
This PR adds support for serde's
#[serde(alias="name")]
field-attribute to our options code generator. Simplifying supporting aliases for the same setting.I'm unsure if we should land this change. I may not end up using it for
line-length
because I think it's better to actually deprecate these options rather than supporting both (by adding support for Rust'sdeprecated
attribute). However, it is a neat feature and it already works.Test Plan
I changed
line-length
toAnd generated the options markdown