Skip to content
This repository was archived by the owner on Dec 25, 2021. It is now read-only.

Commit 2663974

Browse files
authored
Sort deps (#2)
* Add Sort dependencies command * Improvements and refactoring * Fix dockerfile * Refactoring remove unused
1 parent a9ed228 commit 2663974

File tree

6 files changed

+240
-124
lines changed

6 files changed

+240
-124
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ serde = "1.0.103"
1313
serde_derive = "1.0.103"
1414
serde_json = "1.0.42"
1515

16+
walkdir = "2"
17+
regex = "1.3.1"
18+
1619
[profile.release]
1720
lto = true
1821

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ RUN cargo build --release
88

99
FROM scratch
1010

11-
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/pants-cleaner /app
11+
COPY --from=builder /home/rust/src/target/x86_64-unknown-linux-musl/release/dep-sanitizer /app
1212
WORKDIR /project
1313
ENTRYPOINT ["/app"]

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Binary (cargo required - [how to install rust](https://www.rust-lang.org/tools/i
1515

1616
Docker (docker required)(may take a few minutes)
1717

18-
docker build -t dep-sanitizer.
18+
docker build -t dep-sanitizer .
1919

2020

2121
## How to use

src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct Config {
2323
#[structopt(short, long, default_value = "src/scala/")]
2424
prefix: String,
2525

26-
/// If dependency was annotated with this marker tath it will be skipped to sanitize(removing)
26+
/// If dependency was annotated with this marker it will be skipped to sanitize(removing)
2727
#[structopt(short, long, default_value = "#skip-sanitize")]
2828
skip_marker: String,
2929

@@ -45,6 +45,10 @@ pub enum Command {
4545
#[structopt(subcommand)]
4646
cmd: UndeclaredSubCommand,
4747
},
48+
/// Finds all BUILD files downstream to the current folder (with --prefix) and sorts dependencies
49+
/// in 'dependencies' and 'exports' blocks, adds trailing comma and replace " to ' as well
50+
#[structopt(name = "sort")]
51+
Sort {},
4852
}
4953

5054
#[derive(StructOpt, Debug)]

0 commit comments

Comments
 (0)