Skip to content
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

Invalid rusty-hook config file #181

Closed
2 of 6 tasks
sudhirdhumal289 opened this issue Dec 25, 2021 · 1 comment
Closed
2 of 6 tasks

Invalid rusty-hook config file #181

sudhirdhumal289 opened this issue Dec 25, 2021 · 1 comment

Comments

@sudhirdhumal289
Copy link

sudhirdhumal289 commented Dec 25, 2021

Environment Details

  • Operating System
    • Linux
    • Mac
    • Windows
  • Rust Version: 1.57.0
  • Rust Release Channel
    • Stable
    • Nightly
    • Beta
  • Cargo Version: 1.57.0
  • rusty-hook Version: 0.11.2

Description

Somehow git hooks were not registered after removing .git/hooks, crate dependency. So removed cargo cache, removed project and pulled it back now its working but getting error that config file is not valid

I'm using workspace feature, which contains one binary crate and binary crate itself depends on rusty-hook and rust-hook.toml file is present in workspace root directory.

.rusty-hook.toml file contents:

[hooks]
pre-commit = "cargo check"
pre-push = [
    "rustup component add rustfmt",
    "rustup component add clippy",
    "cargo fmt -- --check",
    "cargo clippy -- -D warnings",
    "rustup component add llvm-tools-preview",
    "export RUSTC_BOOTSTRAP=1",
    "export RUSTFLAGS=\"-Zinstrument-coverage\"",
    "export LLVM_PROFILE_FILE=\"planned-tasks-%p-%m.profraw\"",
    "cargo build --verbose",
    "cargo test --verbose",
    "rm *.profraw",
    "grcov . -s . --binary-path ./target/debug/ -t html --branch --ignore-not-existing -o ./target/debug/coverage/"
]

[logging]
verbose = true

Tried removing environment variables as well but getting same error.
Error:

Invalid rusty-hook config file
Configured hook command failed
pre-push hook rejected
error: failed to push some refs to 'gitlab.com:
@sudhirdhumal289 sudhirdhumal289 changed the title Not working when - Removed hooks from git directory and then re-added package in cargo.toml Invalid rusty-hook config file Dec 25, 2021
@calebcartwright
Copy link
Member

Thanks for reaching out, but this is correct.

You are using the latest released (and usable) version published on crates.io, v0.11.2, however, you are trying to use a the hook-as-array feature that does not exist in your version; the array support was added in the unusable, unreleased v0.12.0 (https://github.com/swellaby/rusty-hook/blob/master/CHANGELOG.md#added, refs #171)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants