-
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
Move Settings
and ResolverSettings
to ruff_workspace
#7544
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
CodSpeed Performance ReportMerging #7544 will not alter performanceComparing Summary
|
f5511a2
to
5d1d3c6
Compare
2e4a95a
to
030293a
Compare
030293a
to
9452ec3
Compare
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.
Makes sense, that's an impressive refactor.
9452ec3
to
6cc6cee
Compare
5d1d3c6
to
202815b
Compare
6cc6cee
to
4323547
Compare
202815b
to
4cdd24c
Compare
4323547
to
e1aa031
Compare
4cdd24c
to
0efdc80
Compare
e1aa031
to
2421373
Compare
0efdc80
to
308bae8
Compare
Merge Activity
|
2421373
to
1ebf2ea
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
One followup here is that I think the paths in CONTRIBUTING.md need to be updated to reference these structs? |
@samschlegel - Great catch, thanks! PR welcome or I can fix it up :) |
I ran into it while reading it and I'm not entirely sure what's moved where so would probably be easier for you to do at the moment 😅 |
It looks like a few things are out-of-date in that section so I'll do some clean-up. |
## Summary See: #7544 (comment).
Summary
Stack Summary
This stack splits
Settings
intoFormatterSettings
andLinterSettings
and moves it intoruff_workspace
. This change is necessary to add theFormatterSettings
toSettings
without addingruff_python_formatter
as a dependency toruff_linter
(and the linter should not contain the formatter settings).A quick overview of our settings struct at play:
Options
: 1:1 representation of the options in thepyproject.toml
orruff.toml
. Used for deserialization.Configuration
: ResolvedOptions
, potentially merged from multiple configurations (when usingextend
). The representation is very close if not identical to theOptions
.Settings
: The resolved configuration that uses a data format optimized for reading. Optional fields are initialized with their default values. Initialized byConfiguration::into_settings
.The goal of this stack is to split
Settings
into tool-specific resolvedSettings
that are independent of each other. This comes at the advantage that the individual crates don't need to know anything about the other tools. The downside is that information gets duplicated betweenSettings
. Right now the duplication is minimal (line-length
,tab-width
) but we may need to come up with a solution if more expensive data needs sharing.This stack focuses on
Settings
. SplittingConfiguration
into some smaller structs is something I'll follow up on later.PR Summary
This PR moves the
ResolverSettings
andSettings
struct toruff_workspace
.LinterSettings
remains inruff_linter
because it gets passed to lint rules, theChecker
etc.Test Plan
cargo test