1
Fork 0
mirror of https://github.com/RGBCube/alejandra synced 2025-07-30 12:07:46 +00:00

feat: sort paths and print them

This commit is contained in:
Kevin Amado 2022-01-26 21:15:17 -05:00
parent 8acbd26031
commit dad66a7ff0
No known key found for this signature in database
GPG key ID: FFF341057F503148
2 changed files with 5 additions and 1 deletions

View file

@ -1,5 +1,8 @@
pub fn nix_files(paths: Vec<&str>) -> Vec<String> {
paths.iter().flat_map(nix_files_in_path).collect()
let mut paths: Vec<String> =
paths.iter().flat_map(nix_files_in_path).collect();
paths.sort();
paths
}
fn nix_files_in_path(path: &&str) -> Vec<String> {

View file

@ -19,6 +19,7 @@ fn main() -> std::io::Result<()> {
eprintln!("Formatting {} files.", paths.len());
for path in paths {
alejandra::format::file(&config, &path)?;
eprintln!("Formatting: {}", path);
}
}
None => {