numtide / treefmt-nix

treefmt nix configuration
https://numtide.github.io/treefmt/
MIT License
213 stars 62 forks source link

`ruff check` should probably add `--fix` #177

Closed declension closed 1 month ago

declension commented 2 months ago

Describe the bug Since the very useful #175, we can now check and format with Ruff

To Reproduce

  1. Mess up some Python files in a way that ruff check isn't happy about, e.g. unused import
  2. run nix fmt

Expected behavior Anything that can be fixed should be fixed.

Actual behavior There are errors printed, but no action taken, e.g.

    ...
    tests/test_auth.py:6:27: F401 [*] `unittest.mock.create_autospec` imported but unused
    tests/test_auth.py:7:32: F401 [*] `starlette.requests.Request` imported but unused
    Found 15 errors.
    [*] 15 fixable with the `--fix` option.
zimbatm commented 2 months ago

/cc @pvsr