-
-
Notifications
You must be signed in to change notification settings - Fork 702
Fix Ruff import sorting when fix batches omit package markers #23298
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
Changes from 4 commits
d9d060a
81fb6b6
66a73ab
87bcfaf
e5ba091
df88922
3439c91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,6 +22,7 @@ | |
| @dataclass(frozen=True) | ||
| class RunRuffRequest: | ||
| snapshot: Snapshot | ||
| files: tuple[str, ...] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Bear with me, as I haven't had my coffee - but why do we have this So, it's files for the files we want fixed, while snapshot is files + init.py?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Exactly.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In terms of naming, |
||
| mode: RuffMode | ||
|
|
||
|
|
||
|
|
@@ -71,12 +72,12 @@ async def run_ruff( | |
|
|
||
| result = await execute_process( | ||
| Process( | ||
| argv=(exe_path, *initial_args, *conf_args, *ruff.args, *request.snapshot.files), | ||
| argv=(exe_path, *initial_args, *conf_args, *ruff.args, *request.files), | ||
| input_digest=input_digest, | ||
| immutable_input_digests={immutable_input_key: ruff_tool.digest}, | ||
| output_files=request.snapshot.files, | ||
| output_files=request.files, | ||
| output_directories=(REPORT_DIR,) if request.mode is RuffMode.LINT else (), | ||
| description=f"Run ruff {' '.join(initial_args)} on {pluralize(len(request.snapshot.files), 'file')}.", | ||
| description=f"Run ruff {' '.join(initial_args)} on {pluralize(len(request.files), 'file')}.", | ||
| level=LogLevel.DEBUG, | ||
| ), | ||
| **implicitly(), | ||
|
|
||
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.