clippy-check icon indicating copy to clipboard operation
clippy-check copied to clipboard

Add support for manifest-path

Open dmontagu opened this issue 3 years ago • 3 comments

I believe this change will enable GitHub to correctly display the annotations in-line when using a Cargo.toml that is not in the project root.

  • Adds manifest-path: option to the action
  • When manifest-path is specified, inserts --manifest-path <value> into the clippy args list
  • When manifest-path is specified, the generated annotations get the filename prefixed with the parent of the file specified via manifest-path:.

Addresses #28.


Note: I have not (yet) built the dist/index.js (because I couldn't figure out how!).

I couldn't get it to build locally with the existing package.json due to inability to find @actions-rs/core="0.1.3" on npm. I was able to get it to build locally using a local clone, but then I couldn't get to actually work in my own github actions (presumably due to doing something wrong during the build).

I'm relatively inexperienced with npm, typescript, and github actions, so would appreciate any help getting this over the line. (Or an answer to #28)

dmontagu avatar Aug 26 '20 02:08 dmontagu

I'm not familiar with typescript either, but this seems like a reasonable approach. What might be slightly nicer is to make the argument just path instead, and automatically add the /Cargo.toml to the end.

Either way, any chance of getting this merged and released soon?

qwandor avatar Apr 30 '21 21:04 qwandor

Project I'm participating in moved rust stuff into a sub-directory and no more nice lints for us anymore. @svartalf Could you look at this PR?

yisonPylkita avatar May 12 '21 07:05 yisonPylkita

I just tried this on one of my projects and it turns out it's not enough, if the subdirectory has a .cargo/config.toml which sets important things like the the target. Actually running clippy under the subdirectory would be better.

qwandor avatar May 12 '21 09:05 qwandor