refactor: replace reviewdog with direct cargo calls and PR comment - #67
refactor: replace reviewdog with direct cargo calls and PR comment#67alexmohr wants to merge 4 commits into
Conversation
3488859 to
bc47422
Compare
0ae1c3c to
5afa22d
Compare
| run: | | ||
| git fetch --depth=1 origin "${{ inputs.base-sha }}" 2>/dev/null || true | ||
| git diff "${{ inputs.base-sha }}...HEAD" --unified=0 > /tmp/pr.diff | ||
| echo "diff_file=/tmp/pr.diff" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
question: Why is it put as output result, but never used?
| uses: giraffate/clippy-action@v1 | ||
| - name: Post nightly-clippy comment on PR | ||
| if: >- | ||
| inputs.post-pr-comment == 'true' && github.event_name == 'pull_request' && steps.clippy.outputs.has_findings == 'true' && github.event.pull_request.head.repo.full_name == github.repository |
There was a problem hiding this comment.
I think this is missing the ${{ }}, otherwise it's not evaluated
There was a problem hiding this comment.
Seems to work fine on the test PR I did on CDA eclipse-opensovd/classic-diagnostic-adapter#385 (comment), anyhow I will test again once I addressed the remaining issues :)
There was a problem hiding this comment.
No it's not necessary. But after looking at this again after some passed since I created this PR I was still pretty unhappy with how complicated it still is. I dropped all the comment handling for format and clippy, just look at the pipeline output directly.
I did add two small wrapper scripts, so we can configure pre commit properly for format and clippy.
Example for CDA.
Now if you run pre-commit it will run format with the correct nightly stage and clippy with 1.88 and the pinned nightly version.
We might want to update the nightly version to something more recent in the future but that is out of scope for here.
- id: cargo-fmt
args:
- --toolchain=nightly-2025-07-14
- --all
- id: cargo-clippy
name: clippy (stable)
args:
- --toolchain=1.88
- --all-targets
- --locked
- --
- -D
- warnings
- id: cargo-clippy
name: clippy (nightly)
args:
- --toolchain=nightly-2025-07-14
- --all-targets
- --locked
- --
- -D
- warnings780f272 to
c512250
Compare
|
needs rebase (conflict in README) |
- Remove rust-lint-and-format-action reviewdog integration (giraffate/clippy-action, reviewdog setup, checkstyle XML helpers) - Remove shared-config/cargo-fmt.sh and cargo-clippy.sh; pre-commit hooks now call cargo directly (language: system) - Nightly clippy runs warn-only (continue-on-error); findings are posted as a PR comment with a disclaimer that they are informational and may be unrelated to PR changes; no comment posted when clean - New action inputs: toolchain, all-features, post-pr-comment - Document RUSTUP_TOOLCHAIN=nightly as the local opt-in for nightly clippy via prek Signed-off-by: Alexander Mohr <alexander.m.mohr@mercedes-benz.com>
c512250 to
0f19d76
Compare
|
@floroks rebased :) |
Summary
Checklist
Related
Notes for Reviewers