-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
168 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
#[test] | ||
fn generate_with_dep_and_names() { | ||
let dot = std::env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
let mut path = PathBuf::from(&dot); | ||
let mut out = path.clone(); | ||
path.push("target/debug/acknowledge"); | ||
out.push("ACKNOWLEDGEMENTS-DepAndNames.md"); | ||
let output = Command::new(path) | ||
.arg(format!("-p={dot}")) | ||
.arg("--format=DepAndNames") | ||
.arg(format!("--output={}", out.to_str().unwrap())) | ||
.output() | ||
.expect("Failed to run"); | ||
|
||
println!("output: {output:#?}"); | ||
|
||
assert!(output.stderr.is_empty()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
#[test] | ||
fn print_help() { | ||
let dot = std::env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
let mut path = PathBuf::from(&dot); | ||
path.push("target/debug/acknowledge"); | ||
let output = Command::new(path) | ||
.arg(format!("--help")) | ||
.output() | ||
.expect("Failed to run"); | ||
let printed = String::from_utf8(output.stdout).expect("Failed to parse"); | ||
|
||
insta::assert_snapshot!(printed); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
#[test] | ||
fn generate_with_name_and_count() { | ||
let dot = std::env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
let mut path = PathBuf::from(&dot); | ||
path.push("target/debug/acknowledge"); | ||
let output = Command::new(path) | ||
.arg(format!("-p={dot}")) | ||
.output() | ||
.expect("Failed to run"); | ||
|
||
println!("output: {output:#?}"); | ||
|
||
assert!(output.stderr.is_empty()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
use std::path::PathBuf; | ||
use std::process::Command; | ||
|
||
#[test] | ||
fn generate_with_name_and_deps() { | ||
let dot = std::env::var("CARGO_MANIFEST_DIR").unwrap(); | ||
let mut path = PathBuf::from(&dot); | ||
let mut out = path.clone(); | ||
path.push("target/debug/acknowledge"); | ||
out.push("ACKNOWLEDGEMENTS-NameAndDeps.md"); | ||
let output = Command::new(path) | ||
.arg(format!("-p={dot}")) | ||
.arg("--format=NameAndDeps") | ||
.arg(format!("--output={}", out.to_str().unwrap())) | ||
.output() | ||
.expect("Failed to run"); | ||
|
||
println!("output: {output:#?}"); | ||
|
||
assert!(output.stderr.is_empty()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
source: tests/help.rs | ||
expression: printed | ||
--- | ||
acknowledge is a simple CLI tool to analyze dependencies of a Cargo (rust) project and produce an ACKNOWLEDMENTS.md file listing (major) contributors of your dependencies | ||
|
||
Usage: acknowledge [OPTIONS] --path <PATH> [COMMAND] | ||
|
||
Commands: | ||
clear-cache Clears cache | ||
help Print this message or the help of the given subcommand(s) | ||
|
||
Options: | ||
-p, --path <PATH> | ||
Path to Cargo project for analysis | ||
-g, --gh-token <GH_TOKEN> | ||
Running Acknowledgements on any project of reasonable size you're likely to face rate limits. Please provide a personal access token | ||
-o, --output <OUTPUT> | ||
Output file path, defaults to project path if not provided | ||
-m, --mention | ||
Whether to include @ (at) symbol in front of a github user's name | ||
-f, --format <FORMAT> | ||
Format of the output file [default: NameAndCount] | ||
-d, --depth <DEPTH> | ||
Depth of scan, whether to include minor and optional depes contributors [default: Major] | ||
-c, --contributions-threshold <CONTRIBUTIONS_THRESHOLD> | ||
Min number of contributions to be included in the list, doesn't apply to sole contributors [default: 2] | ||
-s, --sources <SOURCES> | ||
List other sources, not specified in Cargo.toml | ||
-t, --template <TEMPLATE> | ||
Use your own template. See https://github.com/anvlkv/acknowledgements/blob/main/src/template.md?plain=1 for reference | ||
-h, --help | ||
Print help | ||
-V, --version | ||
Print version |