mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-12 05:16:24 +00:00
Use new formatter infrastructure in CLI and test (#4767)
* Use dummy verbatim formatter for all nodes * Use new formatter infrastructure in CLI and test * Expose the new formatter in the CLI * Merge import blocks
This commit is contained in:
parent
9bf168c0a4
commit
d4027d8b65
6 changed files with 64 additions and 41 deletions
|
@ -6,12 +6,10 @@ use clap::Parser as ClapParser;
|
|||
use ruff_python_formatter::cli::Cli;
|
||||
use ruff_python_formatter::format_module;
|
||||
|
||||
#[allow(clippy::print_stdout)]
|
||||
fn main() -> Result<()> {
|
||||
let cli = Cli::parse();
|
||||
let contents = fs::read_to_string(cli.file)?;
|
||||
#[allow(clippy::print_stdout)]
|
||||
{
|
||||
println!("{}", format_module(&contents)?.as_code());
|
||||
}
|
||||
println!("{}", format_module(&contents)?.as_code());
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue