Configure `cargo fmt` for consistent formatting of imports
- Vorherrschende Sprache
- Rust
- Sterne
- 9.3k
- Forks
- 2.4k
- Ø Merge
- 3 T. 11 Std.
- Gemergte PRs (30 T.)
- 360
Beschreibung
**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:
``` toml
merge_imports = true
group_imports = "StdExternalCrate"
```
Here is an example of imports formatted with these settings, using the command `cargo +nightly fmt`:
```rust
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
Beitragsleitfaden
Rechercherichtung
Beginne damit, das Layout der Crates und Module des Repositorys zu überprüfen, und prüfe anschließend, wie `cargo +nightly fmt` die vorhandenen Imports formatiert. Füge eine `rustfmt.toml` mit den vorgeschlagenen Einstellungen hinzu und wende sie jeweils auf einen einzelnen Crate oder ein einzelnes Modul an; abgeschlossen ist die Aufgabe, wenn die Imports konsistent gruppiert und formatiert sind, ohne unnötige Änderungen zu verursachen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust
- Bereich
- tooling
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 48/100