Compare commits
No commits in common. "87c53d5e09f38ce1492458be627a6a6d399e6e21" and "d12895184b74f293e3f5b1544f9092e9d18c89cd" have entirely different histories.
87c53d5e09
...
d12895184b
|
@ -1,7 +1,3 @@
|
|||
[[pre_commit]]
|
||||
name = "Cargo Complete Check"
|
||||
command = "cargo make complete-check"
|
||||
|
||||
[[pre_commit]]
|
||||
name = "Typos"
|
||||
command = "typos"
|
||||
|
|
|
@ -1,18 +1,32 @@
|
|||
[env]
|
||||
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
||||
|
||||
[tasks.fmt]
|
||||
command = "cargo"
|
||||
args = ["fmt", "${@}"]
|
||||
|
||||
[tasks.check]
|
||||
command = "cargo"
|
||||
args = ["check", "${@}"]
|
||||
|
||||
[tasks.clippy]
|
||||
command = "cargo"
|
||||
args = ["clippy", "${@}"]
|
||||
|
||||
[tasks.test]
|
||||
command = "cargo"
|
||||
args = ["test", "${@}"]
|
||||
|
||||
[tasks.doc]
|
||||
command = "cargo"
|
||||
args = ["doc", "${@}"]
|
||||
|
||||
[tasks.build]
|
||||
command = "cargo"
|
||||
args = ["build", "${@}"]
|
||||
|
||||
[tasks.complete-check]
|
||||
dependencies = [
|
||||
"format",
|
||||
"check",
|
||||
"clippy",
|
||||
"test",
|
||||
"code-coverage",
|
||||
"docs",
|
||||
"build",
|
||||
"audit-flow",
|
||||
"outdated-flow",
|
||||
]
|
||||
dependencies = ["fmt", "check", "clippy", "test", "doc", "build"]
|
||||
|
||||
[tasks.code-coverage]
|
||||
workspace = false
|
||||
|
@ -24,7 +38,7 @@ args = [
|
|||
"--out=html",
|
||||
"--output-dir=coverage",
|
||||
"--skip-clean",
|
||||
"--target-dir=target/tarpaulin",
|
||||
"--target-dir=target/tarpaulin"
|
||||
]
|
||||
|
||||
[tasks.book]
|
||||
|
|
|
@ -15,7 +15,6 @@ use crate::{cli::InstallArgs, DEFAULT_TEMPLATE, HOOK_TYPES};
|
|||
|
||||
/// The `install` subcommand.
|
||||
pub fn hooked_install(config: Config, args: InstallArgs) -> Result<()> {
|
||||
let silent = args.silent;
|
||||
let git_hooks_dir = PathBuf::from(".git/hooks/");
|
||||
if !git_hooks_dir.exists() {
|
||||
return Err(eyre!("The \".git/hooks/\" directory does not exist"));
|
||||
|
@ -29,12 +28,10 @@ pub fn hooked_install(config: Config, args: InstallArgs) -> Result<()> {
|
|||
|
||||
let hook_path = git_hooks_dir.join(hook_type);
|
||||
if hook_path.exists() && !args.overwrite {
|
||||
if !silent {
|
||||
println!(
|
||||
"{:?} exists, use --overwrite to replace the existing file",
|
||||
hook_path
|
||||
);
|
||||
}
|
||||
println!(
|
||||
"{:?} exists, use --overwrite to replace the existing file",
|
||||
hook_path
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
|
@ -56,10 +56,6 @@ pub struct InstallArgs {
|
|||
/// Overwrite existing files.
|
||||
#[clap(long)]
|
||||
pub overwrite: bool,
|
||||
|
||||
/// Don't output any information.
|
||||
#[clap(long)]
|
||||
pub silent: bool,
|
||||
}
|
||||
|
||||
/// The `uninstall` subcommand arguments.
|
||||
|
|
|
@ -23,7 +23,7 @@ pub struct PrintStyles {
|
|||
pub error: Style,
|
||||
/// The style for skipped hooks output.
|
||||
pub skipped: Style,
|
||||
/// The style for successful hooks output.
|
||||
/// The style for succesful hooks output.
|
||||
pub success: Style,
|
||||
/// The style for hooks with warnings.
|
||||
pub warn: Style,
|
||||
|
|
|
@ -7,16 +7,11 @@ let
|
|||
in
|
||||
mkShell rec {
|
||||
packages = [
|
||||
cargo-audit
|
||||
cargo-edit
|
||||
cargo-insta
|
||||
cargo-make
|
||||
cargo-outdated
|
||||
cargo-tarpaulin
|
||||
mdbook
|
||||
mdbook-linkcheck
|
||||
rustup-toolchain
|
||||
typos
|
||||
];
|
||||
|
||||
shellHook = ''
|
||||
|
@ -28,6 +23,6 @@ mkShell rec {
|
|||
cargo install --path hooked-cli --root $out
|
||||
fi
|
||||
|
||||
hooked install --silent
|
||||
hooked install
|
||||
'';
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue