datafusion
datafusion copied to clipboard
Configure `cargo fmt` for consistent formatting of imports
Is your feature request related to a problem or challenge? Please describe what you are trying to do.
Our imports are very inconsistent and are not currently formatted by cargo fmt other than reordering within groups.
Describe the solution you'd like
I would like to add a rustfmt.toml with these settings:
merge_imports = true
group_imports = "StdExternalCrate"
Here is an example of imports formatted with these settings, using the command cargo +nightly fmt:
use std::{
collections::{HashMap, HashSet},
convert::TryFrom,
fmt::{Display, Formatter},
sync::Arc,
};
use arrow::{
compute::can_cast_types,
datatypes::{DataType, Field, Schema, SchemaRef},
};
use crate::{
error::{DataFusionError, Result, SchemaError},
field_not_found, Column,
};
To minimize disruption, we could do this one crate or module at a time.
Describe alternatives you've considered None
Additional context None