mirror of
https://github.com/RGBCube/alejandra
synced 2025-08-02 05:27:45 +00:00
feat: sort paths and print them
This commit is contained in:
parent
8acbd26031
commit
dad66a7ff0
2 changed files with 5 additions and 1 deletions
|
@ -1,5 +1,8 @@
|
||||||
pub fn nix_files(paths: Vec<&str>) -> Vec<String> {
|
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> {
|
fn nix_files_in_path(path: &&str) -> Vec<String> {
|
||||||
|
|
|
@ -19,6 +19,7 @@ fn main() -> std::io::Result<()> {
|
||||||
eprintln!("Formatting {} files.", paths.len());
|
eprintln!("Formatting {} files.", paths.len());
|
||||||
for path in paths {
|
for path in paths {
|
||||||
alejandra::format::file(&config, &path)?;
|
alejandra::format::file(&config, &path)?;
|
||||||
|
eprintln!("Formatting: {}", path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue