upgrade: dprint 0.3.0-alpha.6

This commit is contained in:
Ryan Dahl 2020-02-03 15:52:32 -05:00 committed by GitHub
parent f4cc08c4fc
commit 0471243334
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 13 deletions

View file

@ -27,12 +27,16 @@ fn is_supported(path: &Path) -> bool {
&& (TYPESCRIPT.is_match(&path_str) || JAVASCRIPT.is_match(&path_str))
}
fn get_config() -> dprint::Configuration {
dprint::ConfigurationBuilder::new()
fn get_config() -> dprint::configuration::Configuration {
dprint::configuration::ConfigurationBuilder::new()
.line_width(80)
.indent_width(2)
.next_control_flow_position(dprint::NextControlFlowPosition::SameLine)
.binary_expression_operator_position(dprint::OperatorPosition::SameLine)
.next_control_flow_position(
dprint::configuration::NextControlFlowPosition::SameLine,
)
.binary_expression_operator_position(
dprint::configuration::OperatorPosition::SameLine,
)
.build()
}
@ -48,7 +52,10 @@ fn get_supported_files(paths: Vec<PathBuf>) -> Vec<PathBuf> {
files_to_check
}
fn check_source_files(config: dprint::Configuration, paths: Vec<PathBuf>) {
fn check_source_files(
config: dprint::configuration::Configuration,
paths: Vec<PathBuf>,
) {
let start = Instant::now();
let mut not_formatted_files = vec![];
@ -91,7 +98,10 @@ fn check_source_files(config: dprint::Configuration, paths: Vec<PathBuf>) {
}
}
fn format_source_files(config: dprint::Configuration, paths: Vec<PathBuf>) {
fn format_source_files(
config: dprint::configuration::Configuration,
paths: Vec<PathBuf>,
) {
let start = Instant::now();
let mut not_formatted_files = vec![];