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

Improve documentation: how to apply feature changes #30

Open
sbeyer opened this issue May 23, 2021 · 3 comments
Open

Improve documentation: how to apply feature changes #30

sbeyer opened this issue May 23, 2021 · 3 comments

Comments

@sbeyer
Copy link

sbeyer commented May 23, 2021

For cargo-husky users that are new to Rust and the cargo system, it might be unclear how to let updated cargo-husky feature changes in Cargo.toml also update the Git hooks.

For example, perform the following steps:

  1. add
    [dev-dependencies.cargo-husky]
    version = "1"
    features = ["precommit-hook", "run-cargo-clippy"]
    to Cargo.toml
  2. invoke cargo test
  3. notice that .git/hooks/pre-commit contains cargo clippy 👍
  4. add "run-cargo-fmt" to the features in Cargo.toml
  5. invoke cargo test
  6. notice that .git/hooks/pre-commit does not contain cargo fmt 👎

My request is to update the README.md to make clear how to "activate" changed feature settings.

@xenoterracide
Copy link

I was just going to report this, do you know how to do it?

@sbeyer
Copy link
Author

sbeyer commented Jun 7, 2021

I was just going to report this, do you know how to do it?

Other than cargo clean? No.

@xenoterracide
Copy link

xenoterracide commented Jun 13, 2021

hmm... I have this in the root Cargo.toml

[dev-dependencies.cargo-husky]
version = "^1"
default-features = false # Disable features which are enabled by default
features = ["precommit-hook", "run-cargo-fmt", "run-for-all"]
❯ cargo clean                                                                                                                     # brix-rust -> ccushing/copy-1a ! $
❯ cargo test    
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
❯ cat .git/hooks/pre-commit                                                                                                         # brix-rust -> ccushing/copy-1a ! $
[bat error]: '.git/hooks/pre-commit': No such file or directory (os error 2)

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