actions-rs / clippy-check

📎 GitHub Action for PR annotations with clippy warnings
https://github.com/marketplace/actions/rust-clippy-check
MIT License
287 stars 40 forks source link

Add working-directory param #158

Open reinismu opened 3 years ago

reinismu commented 3 years ago

Allows to run clippy in subdirectories and corectly puts annotation

You can test with

            - uses: reinismu/clippy-check@master
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}
                  working-directory: my-directory
                  args: --all-features

Related:

93 I change cwd instead of manifest-path

28

mattiekat commented 2 years ago

Is there anything blocking this PR? My team could use this now. We have a mono-repo setup and it at least seems like there is no way to "just cd into the right directory" before running the action.

MariusVB commented 2 years ago

I'm also interested in this but have found a temporary solution. Just replace {CARGO_SUBDIR} with your cargo project directory in your repo and {DIRS_TO_REMOVE} with all the non-cargo directories in the top-level of your repo:


jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      # Moves all files in sub dir to top-level dir
      - run: cd $GITHUB_WORKSPACE && mv {CARGO_SUBDIR}/* .
      # Delete directories not to be audited
      - run: cd $GITHUB_WORKSPACE && rm -rf {DIRS_TO_REMOVE}
      - uses: actions-rs/audit-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
mattiekat commented 2 years ago

I wish this would work for us but our rust code actually imports some headers with the cxx create so we're at the extreme end. If I were really dedicated to making it work I could symlink things, but it's windows so that is annoying, and or restructure.

reinismu commented 2 years ago

While this is not merged in I use my repo to run actions

            - uses: reinismu/clippy-check@master # switch to original when merged https://github.com/actions-rs/clippy-check/pull/158
              with:
                  token: ${{ secrets.GITHUB_TOKEN }}
                  working-directory: your-directory
TimDiekmann commented 2 years ago

While this is not merged in I use my repo to run actions

Works like a charm, thank you!

r-medina commented 2 years ago

very interested in this getting merged in. monorepos don't play nice with the action as it stands

adam-azarchs commented 1 year ago

Seeing as how this repo appears to be unmaintained, and seeing as how @kristof-mattei seems to have forked it into https://github.com/actions-rs-plus/clippy-check for #165, maybe it's time to start pushing PRs that way? I don't know enough about any of the people involved to endorse one fork over another but it would be nice if some kind of consensus was reached. This is always the problem when maintainers step back...

adam-azarchs commented 1 year ago

I've merged this PR into the https://github.com/10XGenomics/clippy-check fork, which is itself a fork off of https://github.com/actions-rs-plus/clippy-check (we're pretty heavy users of clippy-check internally, and we have a few monorepos where this working directory change is vital). We'll probably make a tag there pretty soon.

yisonPylkita commented 1 year ago

Since actions-rs is an organisation it would speed things up if @svartalf could add more people with review&approve permissions @svartalf If you're reading this please consider adding more people

adam-azarchs commented 1 year ago

As they've said elsewhere, they are not comfortable with adding strangers as additional maintainers for a project with this much usage. And they're right, unfortunately. There have been too many incidents with new maintainers surreptitiously injecting malicious code into projects; software supply chain attacks have been on the rise. It's understandable that they wouldn't want to take responsibility for adequately vetting new maintainers.

SKTT1Ryze commented 10 months ago

Is this pr still going on? Hope it be merged soon!

kristof-mattei commented 10 months ago

Is this pr still going on? Hope it be merged soon!

Merged here: https://github.com/actions-rs-plus/clippy-check/pull/387