forked from mirrors/kingfisher
added tests for --branch and --since-commit feature
This commit is contained in:
parent
98333a4bda
commit
9f91cbdab6
9 changed files with 296 additions and 17 deletions
|
|
@ -71,7 +71,7 @@ pub struct BitbucketRepoSpecifiers {
|
|||
pub exclude_repos: Vec<String>,
|
||||
|
||||
/// Enumerate all accessible workspaces or projects
|
||||
#[arg(long, alias = "all-bitbucket-workspaces", requires = "bitbucket_api_url")]
|
||||
#[arg(long, alias = "all-bitbucket-workspaces", requires = "api_url")]
|
||||
pub all_workspaces: bool,
|
||||
|
||||
/// Filter repositories by type
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ pub struct GitHubRepoSpecifiers {
|
|||
alias = "all-orgs",
|
||||
alias = "all-github-organizations",
|
||||
alias = "all-github-orgs",
|
||||
requires = "github_api_url"
|
||||
requires = "api_url"
|
||||
)]
|
||||
pub all_organizations: bool,
|
||||
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ pub struct GitLabRepoSpecifiers {
|
|||
pub exclude_repos: Vec<String>,
|
||||
|
||||
/// Repositories for all groups (Enterprise only)
|
||||
#[arg(long, alias = "all-groups", alias = "all-gitlab-groups", requires = "gitlab_api_url")]
|
||||
#[arg(long, alias = "all-groups", alias = "all-gitlab-groups", requires = "api_url")]
|
||||
pub all_groups: bool,
|
||||
|
||||
/// Filter by repository type
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
use anyhow::bail;
|
||||
use clap::{Args, Subcommand, ValueEnum, ValueHint};
|
||||
use std::path::PathBuf;
|
||||
use std::path::{Path, PathBuf};
|
||||
use strum::Display;
|
||||
use tracing::debug;
|
||||
use url::Url;
|
||||
|
|
@ -210,7 +210,7 @@ impl ScanCommandArgs {
|
|||
ScanInputCommand::Github(args) => {
|
||||
if args.specifiers.is_empty() {
|
||||
bail!(
|
||||
"Specify at least one --user, --org, or use --all-orgs when scanning GitHub"
|
||||
"You must specify at least one --user, --org, or use --all-orgs when scanning GitHub"
|
||||
);
|
||||
}
|
||||
if args.list_only {
|
||||
|
|
@ -234,7 +234,7 @@ impl ScanCommandArgs {
|
|||
ScanInputCommand::Gitlab(args) => {
|
||||
if args.specifiers.is_empty() {
|
||||
bail!(
|
||||
"Specify at least one --user, --group, or use --all-groups when scanning GitLab"
|
||||
"You must specify at least one --user, --group, or use --all-groups when scanning GitLab"
|
||||
);
|
||||
}
|
||||
if args.list_only {
|
||||
|
|
@ -283,7 +283,7 @@ impl ScanCommandArgs {
|
|||
ScanInputCommand::Bitbucket(args) => {
|
||||
if args.specifiers.is_empty() {
|
||||
bail!(
|
||||
"Specify at least one --user, --workspace, --project, or use --all-workspaces when scanning Bitbucket"
|
||||
"You must specify at least one --user, --workspace, --project, or use --all-workspaces when scanning Bitbucket"
|
||||
);
|
||||
}
|
||||
if args.list_only {
|
||||
|
|
@ -309,7 +309,7 @@ impl ScanCommandArgs {
|
|||
ScanInputCommand::Azure(args) => {
|
||||
if args.specifiers.is_empty() {
|
||||
bail!(
|
||||
"Specify at least one --organization, --project, or use --all-projects when scanning Azure DevOps"
|
||||
"You must specify at least one --organization, --project, or use --all-projects when scanning Azure DevOps"
|
||||
);
|
||||
}
|
||||
if args.list_only {
|
||||
|
|
@ -333,7 +333,7 @@ impl ScanCommandArgs {
|
|||
ScanInputCommand::Huggingface(args) => {
|
||||
if args.specifiers.is_empty() {
|
||||
bail!(
|
||||
"Specify at least one --user, --org, --model, --dataset, or --space when scanning Hugging Face"
|
||||
"You must specify at least one --user, --org, --model, --dataset, or --space when scanning Hugging Face"
|
||||
);
|
||||
}
|
||||
if args.list_only {
|
||||
|
|
@ -402,6 +402,16 @@ impl ScanCommandArgs {
|
|||
);
|
||||
}
|
||||
|
||||
for path in &self.scan_args.input_specifier_args.path_inputs {
|
||||
if path.as_path() == Path::new("-") {
|
||||
continue;
|
||||
}
|
||||
|
||||
if !path.exists() {
|
||||
bail!("Error: unrecognized scan target or path does not exist: {}", path.display());
|
||||
}
|
||||
}
|
||||
|
||||
if !used_provider_subcommand {
|
||||
self.scan_args.input_specifier_args.emit_deprecated_warnings();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue