Commit Graph

27 Commits

Author SHA1 Message Date
Nick Cameron
261238ea51 Change use_small_heuristics to an enum and stabilise
Since it is now an enum, we can be future compatible since we can add variants
for different heuristics.

Closes #1974
2018-06-19 13:28:27 +12:00
Nick Cameron
632fab4c95 documentation 2018-05-21 15:54:56 +12:00
Nick Cameron
6541be3c6f Replace use_colored_tty with iatty crate 2018-05-21 15:32:27 +12:00
Nick Cameron
95d6b64829 Replace WriteMode with EmitMode and backup bool 2018-05-21 14:14:09 +12:00
Nick Cameron
843c12601a Use our own FileName struct rather than exporting libsyntax's 2018-05-21 12:08:39 +12:00
Nick Cameron
539d4d9665 Refactor CliOptions 2018-05-21 11:27:25 +12:00
Nick Cameron
432b1cb253 Rationalise error types
cc #2639
2018-05-21 08:58:53 +12:00
Nick Cameron
a3c85cdc41 Reorder the --help message 2018-05-14 11:07:54 +12:00
Nick Cameron
6d0695303a Make some write modes unstable 2018-05-14 10:55:16 +12:00
Nick Cameron
3b23a98d00 Support unstable options
cc #1976
2018-05-14 10:20:51 +12:00
Nick Cameron
5d9f5aa05a Replace --write-mode with --emit
cc #1976
2018-05-13 14:13:24 +12:00
Nick Cameron
8396da1882 Add --backup flag 2018-05-13 13:18:08 +12:00
Nick Cameron
4d9de48e06 Add --check flag.
cc #1976
2018-05-11 20:26:00 +12:00
Nick Cameron
1869888b1a Remove --verbose-diff
Use `--verbose` instead

cc #1976
2018-05-11 13:58:34 +12:00
Nick Cameron
55ac062da0 Add --quiet flag, remove Plain write mode
cc #1976
2018-05-11 13:50:30 +12:00
topecongiro
bd25c7d0f7 Cargo fmt 2018-05-08 06:25:48 +09:00
topecongiro
51c07f4335 Fix up lines exceeding max width 2018-05-06 16:17:09 +09:00
Trevor Spiteri
9b36156020 Do not scale WidthHeuristics when max_width less than 100 2018-05-02 10:38:02 +02:00
topecongiro
43df7dcb0e Run cargo fmt with reorder_impl_items set to true 2018-04-30 16:24:01 +09:00
Tibo
b7df23c3d5
Replace completely std::error with failure crate 2018-04-26 13:48:48 +10:00
Nick Cameron
ca610d35b3 Refactor to make a sensible public API
0.5 - lots of breaking changes

cc #2639
2018-04-20 21:52:02 +12:00
Nick Cameron
7a886e8fe5 Refactoring around write mode in main 2018-04-20 13:42:27 +12:00
David Barsky
f9532ba8d7 Implemented rough draft of check write mode. (#2539)
* Add rough draft of `check` mode. Not unit tested.

* Added assert-cli; simple test case for `--write-mode=check`

* Lightly documented `check` WriteMode

* wrote clearer phrasing for config::options::WriteMode::Check

* Implemented default for WriteMode where default is Overwrite

* Simplified exit code handling

* updated README.md as per @nrc' comment

* collapsed exit-code handling

* Removed write_mode from Summary, introduced partial option parsing earlier

* Handle write-mode parsing in a slightly better way.
2018-04-20 11:14:11 +12:00
Shotaro Yamada
6b3811a358 Use Iterator methods 2018-04-01 22:29:26 +09:00
topecongiro
3999d64f12 Simplify IgnoreList 2018-03-12 08:41:19 +09:00
Seiichi Uchida
84ad70c151 Add ignore config option
For example, with the following config file, rustfmt will ignore `src/types.rs`,
`src/foo/bar.rs` and every file under `examples/` directory.

```toml
[ignore]
files = [
    "src/types.rs",
    "src/foo/bar.rs",
]
directories = [
    "examples",
]
```
2018-03-09 13:37:52 +09:00
Nick Cameron
39301ae5f2 Go back to a non-workspace structure
Kinda reverts https://github.com/rust-lang-nursery/rustfmt/pull/2419
2018-03-02 14:58:23 +13:00