-
Notifications
You must be signed in to change notification settings - Fork 10
Accept local package-lock.json as target #1116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
764dc3d
to
5bed196
Compare
hipcheck/src/cli.rs
Outdated
#[derive(Debug, Clone, clap::Args)] | ||
pub struct CheckPackageLockJsonArgs { | ||
/// package-lock.json to analyze | ||
pub path: String, | ||
} | ||
|
||
impl ToTargetSeedKind for CheckPackageLockJsonArgs { | ||
fn to_target_seed_kind(&self) -> Result<TargetSeedKind> { | ||
let path = PathBuf::from(&self.path); | ||
if path.exists() { | ||
if self.path.ends_with("package-lock.json") { | ||
return Ok(TargetSeedKind::Multi(MultiTargetSeedKind::PackageLockJson( | ||
path, | ||
))); | ||
} | ||
} | ||
Err(hc_error!("The provided package-lock.json does not exist")) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alilleybrinker thoughts on adding PackageLockJson
as a supported hc check
subcommand? Since we are trying to deprecate the hc check repo
invocation style, and the method for detecting package lock json files is so straightforward, we could eschew adding hc check package-lock-json
and force-rely on the target kind detection.
Only drawback is that we can't allow people to coerce the target kind, the file will always have to be named package-lock.json
@KirilldogU not saying to remove this yet
Kirill, can you fix the linting issue on this branch? |
Signed-off-by: Kirill Usubyan <[email protected]>
5bed196
to
69fb0cb
Compare
This is a draft PR until resolving and analyzing Multi-target seeds in parallel is implemented.
Code contains functionality to accept, parse, and convert to a MultiTargetSeed a local package-lock.json.