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

Providing location to Cargo.toml #8

Open
dzieciou opened this issue Jun 19, 2020 · 4 comments
Open

Providing location to Cargo.toml #8

dzieciou opened this issue Jun 19, 2020 · 4 comments

Comments

@dzieciou
Copy link

dzieciou commented Jun 19, 2020

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?

@ghost
Copy link

ghost commented Jun 20, 2020

Hello. Thanks for your activity. Please create Pull request if you know solution to fix this issue

@dzieciou
Copy link
Author

@fdhadzh There's PR from Daniel with a fix for the issue.

Would you be able to review and merge it?

@thatdevsherry
Copy link

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?

@thoroc
Copy link

thoroc commented Jun 19, 2023

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.

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

3 participants