ChartBoost / ruff-action

A GitHub Action for Ruff
Apache License 2.0
121 stars 21 forks source link

Add problem matcher #7

Closed tobiasdiez closed 6 months ago

tobiasdiez commented 10 months ago

With problem matchers, errors are directly shown in the diff. Would be nice if the action could integrate them directly.

See https://github.com/home-assistant/core/blob/dev/.github/workflows/matchers/ruff.json and the slightly improved https://github.com/sagemath/sage/blob/fd04e63981e1377a5cd7d3d54a48dff543d637c0/.github/workflows/ruff-problem-matcher.json for an example.

brucearctor commented 10 months ago

@tobiasdiez -- any interest in contributing this? That'd be welcomed

tobiasdiez commented 10 months ago

@brucearctor Interest yes, but I don't have the time right now to read into how github actions work/are developed. But let me know if you want me to help with implementing/testing the actual problem matchers.

brucearctor commented 10 months ago

Cool -- this isn't something I can prioritize as work anytime soon... But, seems quite interesting, so perhaps something for me on night/weekend [ though also, contributions/collaborations welcomed from anyone! ]

WieeRd commented 7 months ago

There is no need for a problem matcher!

Ruff already provides --output-format option/flag, which can be set to "github". This will produce an output compatible with GitHub's workflow command for creating annotations.

name: Ruff
on: [push, pull_request]
jobs:
  ruff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: chartboost/ruff-action@v1
        with:
          args: check --output-format github

This is all I've got in my workflow, and it does show annotations in the CI run details tab.

WieeRd commented 7 months ago

I think it makes sense for this to be the default behavior if args: input is not given. I'll return with a PR shortly after.

WieeRd commented 7 months ago

Never mind, looks like this was already dealt with in https://github.com/ChartBoost/ruff-action/pull/9. I think we can close this issue now.

brucearctor commented 7 months ago

@tobiasdiez -- did https://github.com/ChartBoost/ruff-action/pull/9 address this, seems OK to close?

tobiasdiez commented 6 months ago

Yes! Thanks @WieeRd