Providing location to Cargo.toml
I have repository that has both Python and Rust code inside.
In the root of the repository I have .pre-commit-config.yaml with:
- repo: https://github.com/doublify/pre-commit-rust
rev: master
hooks:
- id: fmt
args: ['--manifest-path', 'rust_code/Cargo.toml']
In the rust_code/ folder I have rust code together with Cargo.toml.
However, it looks like the hook expects Cargo.toml to be in the root of the repository and is ignoring arguments.
Error during execution of `cargo metadata`: error: could not find `Cargo.toml` in `D:\projects\project-repo` or any parent directory
What options do I have?
Hello. Thanks for your activity. Please create Pull request if you know solution to fix this issue
@fdhadzh There's PR from Daniel with a fix for the issue.
Would you be able to review and merge it?
I think we also need to fix cargo clippy to accept --manifest-path. Right now the hook already has the -- -D warnings appended to the entry command i.e. cargo clippy so it doesn't accept --manifest-path after those arguments.
Shouldn't it only use cargo clippy as entry point and let the user enter the arguments they like?
Is this resolved? I am attempting the same thing with a different error message. I am assuming that passing the --manifest-path option works now.