MCPcopy Create free account
hub / github.com/astral-sh/ruff / parse_cli

Function parse_cli

crates/ruff_dev/src/format_dev.rs:39–47  ·  view source on GitHub ↗
(dirs: &[PathBuf])

Source from the content-addressed store, hash-verified

37use ruff_workspace::resolver::{ResolvedFile, Resolver, RootSettings, project_files_in_path};
38
39fn parse_cli(dirs: &[PathBuf]) -> anyhow::Result<(FormatArguments, ConfigArguments)> {
40 let args_matches = FormatCommand::command()
41 .no_binary_name(true)
42 .get_matches_from(dirs);
43 let mut arguments: FormatCommand = FormatCommand::from_arg_matches(&args_matches)?;
44 arguments.extend_exclude = Some(vec![FilePattern::Builtin("*.md")]);
45 let (cli, config_arguments) = arguments.partition(GlobalConfigArgs::default())?;
46 Ok((cli, config_arguments))
47}
48
49/// Find the [`RootSettings`] to use for formatting.
50fn root_settings_for_formatting(

Callers 1

format_dev_projectFunction · 0.85

Calls 4

commandFunction · 0.85
OkClass · 0.85
partitionMethod · 0.80
defaultFunction · 0.50

Tested by

no test coverage detected