mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-28 12:55:05 +00:00
Narrow the supported options on the format CLI (#6944)
## Summary
Ensures that we only show supported options:
<img width="1228" alt="Screen Shot 2023-08-28 at 11 03 16 AM"
src="50fb7595
-dc30-43d2-a7e4-c0103acc15b9">
For now, I'm not super focused on DRYing up the CLI.
This commit is contained in:
parent
aea7500c1e
commit
ec575188c4
5 changed files with 135 additions and 83 deletions
|
@ -16,12 +16,12 @@ use ruff_python_ast::{PySourceType, SourceType};
|
|||
use ruff_python_formatter::{format_module, FormatModuleError, PyFormatOptions};
|
||||
use ruff_workspace::resolver::python_files_in_path;
|
||||
|
||||
use crate::args::{Arguments, Overrides};
|
||||
use crate::args::{FormatArguments, Overrides};
|
||||
use crate::resolve::resolve;
|
||||
use crate::ExitStatus;
|
||||
|
||||
/// Format a set of files, and return the exit status.
|
||||
pub(crate) fn format(cli: &Arguments, overrides: &Overrides) -> Result<ExitStatus> {
|
||||
pub(crate) fn format(cli: &FormatArguments, overrides: &Overrides) -> Result<ExitStatus> {
|
||||
let pyproject_config = resolve(
|
||||
cli.isolated,
|
||||
cli.config.as_deref(),
|
||||
|
@ -59,7 +59,7 @@ pub(crate) fn format(cli: &Arguments, overrides: &Overrides) -> Result<ExitStatu
|
|||
err
|
||||
})
|
||||
})
|
||||
.collect::<Result<Vec<_>, _>>();
|
||||
.collect::<Result<(), _>>();
|
||||
|
||||
if result.is_ok() {
|
||||
Ok(ExitStatus::Success)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue