astral-sh / ruff-pre-commit

A pre-commit hook for Ruff.
Apache License 2.0
802 stars 38 forks source link

--check option for ruff-format #73

Closed 57an closed 4 months ago

57an commented 4 months ago

Such option is available in ruff format, but inside precommit config gives no effect.

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.3.0
    hooks:
      - id: ruff-format
    args: ['--check']

now results as reformatting instead of just checking

Possibly it is a repeat of https://github.com/astral-sh/ruff-pre-commit/issues/61, but in black there is ability to just check without formating

edgarrmondragon commented 4 months ago

You might have the wrong indentation:

  - repo: https://github.com/astral-sh/ruff-pre-commit
    rev: v0.3.0
    hooks:
      - id: ruff-format
        args: ['--check'] # <- here!
57an commented 4 months ago

oh, my.. thanks it helps