-
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
Extract ResolverSettings
#7542
Merged
Merged
Extract ResolverSettings
#7542
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MichaReiser
force-pushed
the
resolver-settings
branch
from
September 20, 2023 12:23
5b14236
to
3d6bc48
Compare
This was referenced Sep 20, 2023
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
This was referenced Sep 20, 2023
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
MichaReiser
force-pushed
the
merge-settings-and-all-settings
branch
from
September 20, 2023 12:58
22d29dd
to
530dba0
Compare
MichaReiser
force-pushed
the
resolver-settings
branch
from
September 20, 2023 12:58
3d6bc48
to
ed3a426
Compare
charliermarsh
approved these changes
Sep 20, 2023
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.
This is great.
MichaReiser
force-pushed
the
merge-settings-and-all-settings
branch
from
September 20, 2023 13:46
530dba0
to
49afb83
Compare
MichaReiser
force-pushed
the
resolver-settings
branch
from
September 20, 2023 13:56
ed3a426
to
ae5409e
Compare
MichaReiser
force-pushed
the
resolver-settings
branch
from
September 20, 2023 14:17
ae5409e
to
733747c
Compare
Merge Activity
|
This was referenced Sep 20, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 extracts a
ResolverSettings
struct that holds all the resolver-relevant fields (uninteresting for theFormatter
orLinter
). This will allow us to move theResolverSettings
out ofruff_linter
further up in the stack.Test Plan
cargo test
(I'll to more extensive testing at the top of this stack)