Formatter: Detect line endings (#7054)

This commit is contained in:
Micha Reiser 2023-09-04 08:09:31 +02:00 committed by GitHub
parent 834566f34f
commit 93ca8ebbc0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 8 deletions

View file

@ -1,4 +1,5 @@
use thiserror::Error;
use tracing::Level;
use ruff_formatter::prelude::*;
use ruff_formatter::{format, FormatError, Formatted, PrintError, Printed, SourceCode};
@ -119,6 +120,7 @@ impl From<ParseError> for FormatModuleError {
}
}
#[tracing::instrument(level=Level::TRACE, skip_all, err)]
pub fn format_module(
contents: &str,
options: PyFormatOptions,