Skip to content

refactor: replace reviewdog with direct cargo calls and PR comment - #67

Open
alexmohr wants to merge 4 commits into
mainfrom
feature/improve-workflows
Open

refactor: replace reviewdog with direct cargo calls and PR comment#67
alexmohr wants to merge 4 commits into
mainfrom
feature/improve-workflows

Conversation

@alexmohr

Copy link
Copy Markdown
Contributor

Summary

  • 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

Checklist

  • I have tested my changes locally
  • I have added or updated documentation
  • I have linked related issues or discussions
  • I have added or updated tests

Related

Notes for Reviewers

@alexmohr
alexmohr force-pushed the feature/improve-workflows branch 12 times, most recently from 3488859 to bc47422 Compare June 17, 2026 12:47
@alexmohr
alexmohr marked this pull request as ready for review June 17, 2026 13:37
@alexmohr
alexmohr force-pushed the feature/improve-workflows branch 2 times, most recently from 0ae1c3c to 5afa22d Compare June 18, 2026 20:00
Comment thread .pre-commit-hooks.yaml Outdated
Comment thread rust-lint-and-format-action/action.yml Outdated
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"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: Why is it put as output result, but never used?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Comment thread rust-lint-and-format-action/action.yml Outdated
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

@floroks floroks Jun 29, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is missing the ${{ }}, otherwise it's not evaluated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@alexmohr
alexmohr force-pushed the feature/improve-workflows branch 12 times, most recently from 780f272 to c512250 Compare July 1, 2026 09:14
@floroks

floroks commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

needs rebase (conflict in README)

alexmohr added 3 commits July 23, 2026 20:35
- 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>
@alexmohr
alexmohr force-pushed the feature/improve-workflows branch from c512250 to 0f19d76 Compare July 23, 2026 18:35
@alexmohr

Copy link
Copy Markdown
Contributor Author

@floroks rebased :)

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

Successfully merging this pull request may close these issues.

2 participants