-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
Refactor prior_formatter_result
and its usage
#14987
Conversation
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
@@ -49,7 +48,6 @@ class GoogleJavaFormatToolLockfileSentinel(GenerateToolLockfileSentinel): | |||
@dataclass(frozen=True) | |||
class Setup: |
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.
Trying to elide this class with the JvmProcess
directly causes a graph error :|
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.
Sorry for the trouble there. If you want to open a ticket about that linked to #11269 feel free.
prior_formatter_result
and it's usage prior_formatter_result
and its usage
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.
Thanks!
src/python/pants/backend/codegen/protobuf/lint/buf/format_rules.py
Outdated
Show resolved
Hide resolved
@@ -49,7 +48,6 @@ class GoogleJavaFormatToolLockfileSentinel(GenerateToolLockfileSentinel): | |||
@dataclass(frozen=True) | |||
class Setup: |
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.
Sorry for the trouble there. If you want to open a ticket about that linked to #11269 feel free.
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.
Yay! +1 to stu's suggestion, several files need it
this is plugin API change, not internal
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
prior_formatter_result
and its usage prior_formatter_result
and its usage
# Rust tests and lints will be skipped. Delete if not intended. [ci skip-rust] # Building wheels and fs_util will be skipped. Delete if not intended. [ci skip-build-wheels]
The main change here is renaming
prior_formatter_result
to besnapshot
, and removing| None
from its type.Then call-sites must be refactored to remove the
if None
conditional since its neverNone
. Which then leads to removing thesource_files
Get
.Also, now
original_snapshot
in most formatter'sSetup
is superfluous. So it can be replaced by theProcess
it contains. More refactoring.Lastly, I added
FmtResult.create
since therequest
/result
contain most of the requisite info.[ci skip-rust]
[ci skip-build-wheels]