ChartBoost / ruff-action

A GitHub Action for Ruff
Apache License 2.0
128 stars 20 forks source link

Add --output-format=github to README or consider as default #23

Closed dlackty closed 6 months ago

dlackty commented 6 months ago

The ruff linter offers a valuable option, --output-format=github, which generates output in the GitHub annotations format. This allows seamless integration of lint errors within the GitHub UI.

It would be beneficial to:

  1. Include mention of this option in the README for improved user awareness.
  2. Explore the possibility of setting --output-format=github as the default behavior of this project.

ref: https://docs.astral.sh/ruff/settings/#output-format

brucearctor commented 6 months ago

@dlackty , for your number 2, I believe this is already the case --> https://github.com/ChartBoost/ruff-action/blob/main/action.yml#L32 ... ruff picks up the ENV VAR to then use that output.

Since that is the case, I don't think more users need to be made aware. Our purpose is to make ruff usable in GH easily. Ruff is the correct place for docs on ALL ruff options.

That said, a little update in the README for people that haven't read the action or repo in depth informing them that this uses github output format might be useful -- namely so that people do not submit this same question. Feel free to submit a PR to update the docs if you believe that'd be useful.

Since I believe this is already the behavior, I am marking as CLOSED.

dlackty commented 6 months ago

Hi @brucearctor,

Thanks for clarifying! I found the issue was due to an older version of ChartBoost/ruff-action. It seems v1 was pinned to an outdated commit. Switching to ChartBoost/ruff-action@main resolved the problem.

To improve things for future users, might it be worth retagging v1 to a newer version (specifically, after #6 was fixed in #9)?

brucearctor commented 6 months ago

thanks, ya, re-released/tagged v1 for now

lucaaamaral commented 6 months ago

I'm trying not to open a new issue if that's not the case, I'm trying to set up automatic comment on PR that fails the ruff lint, but I'm currently unable to export the ruff output from the actions environment. Is there currently a way on how to export it's output trough the GITHUB_OUTPUT variable or a similar approach? Even to a file outside the repository to be read afterwards might work.