ChartBoost / ruff-action

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

Formatting is wrong, action still passes #11

Open RomeoAva opened 7 months ago

RomeoAva commented 7 months ago

Hi, I am a new user to Ruff (transitioning from Black). I am trying to setup this action on my repo to have the same functionalities I had with Black.

For example:

app = FastAPI(
    title="API",
    description="API",
    version="0.0.1",terms_of_service="https://example.com/",
)

With this code block, the formatting is wrong, it should be

app = FastAPI(
    title="API",
    description="API",
    version="0.0.1",
    terms_of_service="https://example.com/"
)

And this is indeed fixed once I do the command ruff format app/main.py.

But when opening a pull request, ruff-action doesnt seem to mind that formatting mistake. How could I make it more strict in this sense to enforce the code formatting rules?

Here is my action:

name: Ruff
on: [push, pull_request]
jobs:
  ruff:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: chartboost/ruff-action@v1

Thank you for your help

brucearctor commented 7 months ago

do you have ruff configured in your repo?

Ex: https://docs.astral.sh/ruff/configuration/

The action [ and running locally ] expects a configuration file to tell it how to behave.

brucearctor commented 7 months ago

The action currently specifies that this runs 'check'. I imagine format would be additional configuration to tell the action to do this. We could also add more shorthand options, should you wish to submit a PR.