cargo-action-fmt

Crates.iocargo-action-fmt
lib.rscargo-action-fmt
version1.0.4
sourcesrc
created_at2022-02-13 16:43:09.415919
updated_at2022-12-04 23:33:58.219328
descriptionConverts cargo check (and clippy) JSON output to the GitHub Action error format
homepage
repositoryhttps://github.com/olix0r/cargo-action-fmt
max_upload_size
id531817
size21,488
Oliver Gould (olix0r)

documentation

README

cargo-action-fmt

Takes JSON-formatted cargo check (and cargo clippy) output and formats it for GitHub actions.

Examples

This tool can be used with a variety of cargo commands:

:; cargo check -q --message-format=json | cargo-action-fmt
:; cargo clippy -q --message-format=json | cargo-action-fmt
:; cargo doc --message-format=json | cargo-action-fmt

Note that this tool does not currently support cargo fmt or cargo test output. However, you can invoke cargo test so that test compilation errors are annotated properly:

:; cargo test --no-run --message-format=json | cargo-action-fmt

GitHub Action

It's primarily intended to be used in a GitHub Actions workflow:

  docs:
    runs-on: ubuntu-latest
    container: rust:slim
    steps:
      - uses: olix0r/cargo-action-fmt/setup@v2
      - uses: actions/checkout@v2
      - run: cargo doc --no-deps --message-format=json | cargo-action-fmt

Example annotation

Commit count: 103

cargo fmt