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

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

@taufik-rama

Description

@taufik-rama

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions