Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Support outputing raw 'clippy' output into a file #159

Open
2 of 3 tasks
taufik-rama opened this issue Sep 20, 2021 · 2 comments
Open
2 of 3 tasks

Support outputing raw 'clippy' output into a file #159

taufik-rama opened this issue Sep 20, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@taufik-rama
Copy link

Do the checklist before filing an issue:

Motivation

Basically what the title said, I think it's nice to add support so that the raw output of cargo clippy is stored in a file

Workflow example

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Clippy check
        uses: actions-rs/clippy-check@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          args: --all-features
          output: clippy.json # this new attribute

Additional context

Currently I'm trying to integrate some rust projects with SonarQube action. It needs the clippy output to be parsed & sent into the server

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      # ...
      - name: Code Analysis
        uses: sonarsource/sonarqube-scan-action@master
        with:
          args: -Dsonar.rust.clippy.reportPaths=clippy.json # this is the `cargo clippy` output

Currently I'm only able to do that by basically re-running the cargo clippy command & storing the output

  build:
    runs-on: ubuntu-latest

    steps:
      # ...
      - name: Clippy check (file)
        run: cargo clippy --message-format=json > clippy.json

It would be nice if this action could store the raw output somewhere. For the implementation I could think that a simple tee command could do the trick, like:

$ cargo clippy --message-format=json | tee clippy.json

Would basically produce the same output as usual into stdout & also into a file clippy.json

@taufik-rama taufik-rama added the enhancement New feature or request label Sep 20, 2021
@taufik-rama
Copy link
Author

For the third checklist, I'll try to see how it could be done on the source code

@taufik-rama
Copy link
Author

Seems more complicated than I imagine 😅 , I don't usually use current build system

Other approach that I thought might be possible is to add an input that points to the raw $ cargo clippy output file instead, and we could just read that file instead of doing the exec of cargo inside the script

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Development

No branches or pull requests

1 participant