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

Add working-directory param

Open reinismu opened this issue 4 years ago • 12 comments

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

reinismu avatar Aug 19 '21 14:08 reinismu

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.

mattiekat avatar Oct 25 '21 17:10 mattiekat

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 }}

MariusVB avatar Oct 26 '21 14:10 MariusVB

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.

mattiekat avatar Oct 26 '21 15:10 mattiekat

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

reinismu avatar Oct 26 '21 17:10 reinismu

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

Works like a charm, thank you!

TimDiekmann avatar Dec 15 '21 10:12 TimDiekmann

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

r-medina avatar Jul 31 '22 21:07 r-medina

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 avatar Oct 13 '22 05:10 adam-azarchs

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.

adam-azarchs avatar Dec 08 '22 05:12 adam-azarchs

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

yisonPylkita avatar Feb 19 '23 09:02 yisonPylkita

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.

adam-azarchs avatar Feb 19 '23 20:02 adam-azarchs

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

SKTT1Ryze avatar Oct 10 '23 12:10 SKTT1Ryze

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

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

kristof-mattei avatar Oct 11 '23 02:10 kristof-mattei