ruff/crates/ruff_cli
Charlie Marsh fad23bbe60
Add a --check flag to the formatter CLI (#6982)
## Summary

Returns an exit code of 1 if any files would be reformatted:

```
ruff on  charlie/format-check:main [$?⇡] is 📦 v0.0.286 via 🐍 v3.11.2 via 🦀 v1.72.0
❯ cargo run -p ruff_cli -- format foo.py --check
   Compiling ruff_cli v0.0.286 (/Users/crmarsh/workspace/ruff/crates/ruff_cli)
    Finished dev [unoptimized + debuginfo] target(s) in 1.69s
     Running `target/debug/ruff format foo.py --check`
warning: `ruff format` is a work-in-progress, subject to change at any time, and intended only for experimentation.
1 file would be reformatted
ruff on  charlie/format-check:main [$?⇡] is 📦 v0.0.286 via 🐍 v3.11.2 via 🦀 v1.72.0 took 2s
❯ echo $?
1
```

Closes #6966.
2023-08-29 12:40:00 -04:00
..
resources/test/fixtures Include file permissions in key for cached files (#5901) 2023-07-25 17:06:47 +00:00
src Add a --check flag to the formatter CLI (#6982) 2023-08-29 12:40:00 -04:00
tests Respect .ipynb and .pyi sources when linting from stdin (#6628) 2023-08-16 20:33:59 +00:00
Cargo.toml Add a --check flag to the formatter CLI (#6982) 2023-08-29 12:40:00 -04:00