Commit Graph

30 Commits

Author SHA1 Message Date
Nick Cameron
82d95cc4e0 Merge pull request #1724 from topecongiro/multiline-string-lit
Align multiline string literal
2017-06-19 13:02:21 +12:00
Nick Cameron
34fa428471 make file_lines::Range public 2017-06-19 12:58:29 +12:00
Seiichi Uchida
75d86eb1a0 Format source codes 2017-06-18 22:45:08 +09:00
topecongiro
208ff15954 Format source codes 2017-06-16 08:49:49 +09:00
Nick Cameron
1f512948a0 Reformat source code using new defaults 2017-06-13 14:41:49 +12:00
topecongiro
86856491bc Format source codes 2017-05-25 16:08:08 +09:00
Nick Cameron
80f3b3c9c4 Remove multimap dep 2017-05-25 15:59:06 +12:00
topecongiro
04bb5d8929 Format source codes 2017-05-24 00:07:02 +09:00
Michael Killough
9e26575ed8 Use unreachable!() instead of panic!(). 2017-05-18 11:09:11 +07:00
Michael Killough
7a4955f705 Add methods to serialize Config to TOML.
Two different modes:

 - Serialize the full Config object. This is useful as
   `Config::default().to_toml()` to output a rustfmt.toml with defaults
   (#317).
 - Serialize only the options that have been accessed. This could be
   useful to output a minimal rustfmt.toml for a project. (If the
   default value of any unused config item changes, you'll then get the
   new default when you come to use it).

This commit doesn't expose this anywhere - deciding a sensible CLI is a
bit trickier.

This commit also has very simple error reporting (Result<String,
String>) - once the CLI is decided, a more sensible method of reporting
errors might become obvious.
2017-05-16 18:08:24 +07:00
Nick Cameron
d1682b3473 Merge pull request #1510 from fintelia/better-filelines
Better file_lines
2017-05-15 09:19:18 +12:00
Jonathan Behrens
9f83f29187
Refactor file range checking 2017-05-13 13:14:24 -04:00
topecongiro
2776615dc9 Replace 'try!' with '?' 2017-05-08 13:14:23 +09:00
Jonathan Behrens
b1c9832c9b
Respect file_lines within write_snippet() function 2017-05-06 17:59:51 -04:00
Jonathan Behrens
7c6479358b
Respect file_lines within format_lines() function 2017-05-06 15:14:44 -04:00
Nick Cameron
8579c1db0e Merge pull request #1495 from topecongiro/poor-formatting/closure
Fix weird indentation inside closures
2017-05-04 17:15:58 +12:00
est31
78d4ef1992 Drop rustc-serialize, use serde, update toml dependency 2017-05-03 10:23:50 +02:00
topecongiro
f5da9d779f Format source codes 2017-05-03 11:26:25 +09:00
topecongiro
02c9ac93be Prohibit long return val from 'rewrite_closure_block' 2017-04-17 23:17:17 +09:00
Jonathan Behrens
56da223dc2 --file_lines argument now supports "stdin" 2017-03-30 19:35:58 -04:00
Jonathan Behrens
36f0402bac Canonicalize range path in FileLines::intersects() 2017-03-29 18:50:39 -04:00
Nick Cameron
5305bc8436 test fallout 2017-03-28 11:25:59 +13:00
Nick Cameron
5fb1140688 fallout - source reformatting 2017-03-28 11:14:47 +13:00
Nick Cameron
a7612cc773 more fallout 2017-02-23 13:15:48 +13:00
Nick Cameron
9eb78a3333 Fallout 2017-02-23 13:15:48 +13:00
Nick Cameron
4418fab4f2 Update to latest Syntex
+ Cargo update
+ 0.6.2 release
2016-09-16 15:28:02 +12:00
Stuart Dootson
9750fb7fca Canonicalize file paths within the map of file line ranges (#1098)
* Canonicalize file paths within the map of file line ranges

* Forgot to run the tests - and of course, the formatting of the canonicalization change was off, but it's fixed now!

* Move imports to the top of the file, as per @nrc.

* Change `canonicalize_path_string` to return `Option<String>`, `None` indicating an error rather than an empty string

* `format!` is better than string concatenation...

* Change `canonicalize_path_string` to return `Result` rather than `Option`
2016-07-19 09:05:01 +12:00
Kamal Marhubi
66483017f6 Explain that FileLines cannot be given in rustfmt.toml
This adds a note to both the `--config-help` output for `file_lines`,
and to the panic message on attempting to deserialize a `FileLines`
struct.
2016-05-31 01:35:18 +02:00
Kamal Marhubi
a83f1a197e Add copyright notices to added files 2016-05-31 01:34:07 +02:00
Kamal Marhubi
c311b30cac Add type to represent collection of lines in files
This commit adds a type to represent lines in files, and adds it to the
`Config` struct. It will be used for restricting formatting to specific
lines.

Refs #434
2016-05-31 01:24:38 +02:00