Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature to both lint and check format in a single action #23

Open
augustelalande opened this issue Dec 7, 2024 · 2 comments
Open

Feature to both lint and check format in a single action #23

augustelalande opened this issue Dec 7, 2024 · 2 comments

Comments

@augustelalande
Copy link

augustelalande commented Dec 7, 2024

I would like an option to also check formatting in addition to the default lint check. As far as I can tell this is not possible even playing with the args as it is today (I'm aware of astral-sh/ruff#8232).

My ideal invocation would be

- uses: astral-sh/ruff-action@v2
  with:
    check_format: true

I'm willing to contribute it if people find it useful.

@eifinger
Copy link
Collaborator

eifinger commented Dec 8, 2024

You can currently achieve this with either using the installed ruff

- uses: astral-sh/ruff-action@v2
- run: ruff format

or using the action several times.

- uses: astral-sh/ruff-action@v2
- uses: astral-sh/ruff-action@v2
  with:
    args: "format --check"

I am hesitant to include a temporary workaround in this action with astral-sh/ruff#8232 already being discussed, because it means more maintenance overhead, possible breaking changes etc.

@daveisfera
Copy link

Might not be worth the trouble, but another way to consider it is that the action could currently abstract away the fact that it's 2 commands and then there wouldn't be a need for a workflow change once ruff support doing both natively

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants