mirror of
https://github.com/astral-sh/ruff
synced 2026-01-20 21:10:48 -05:00
Implement From conversion for style detector-to-generator (#1678)
This commit is contained in:
@@ -22,11 +22,7 @@ pub fn main(cli: &Cli) -> Result<()> {
|
||||
let python_ast = parser::parse_program(&contents, &cli.file.to_string_lossy())?;
|
||||
let locator = SourceCodeLocator::new(&contents);
|
||||
let stylist = SourceCodeStyleDetector::from_contents(&contents, &locator);
|
||||
let mut generator = SourceCodeGenerator::new(
|
||||
stylist.indentation(),
|
||||
stylist.quote(),
|
||||
stylist.line_ending(),
|
||||
);
|
||||
let mut generator: SourceCodeGenerator = (&stylist).into();
|
||||
generator.unparse_suite(&python_ast);
|
||||
println!("{}", generator.generate());
|
||||
Ok(())
|
||||
|
||||
Reference in New Issue
Block a user