Victor M. Suarez
4f8938c616
Allow for setting of write-mode via config file. FIxes #215
...
Also from @marcusklaas:
Refactor code output functions
Specifically, `write_all_files` no longer returns a HashMap. It would sometimes
contain items, and sometimes be empty. When "fixed" newlines are required, this
must now be done with a separate call. The tests use this strategy and should now pass!
2016-01-12 18:12:48 -05:00
Marcus Klaas de Vries
ba465e0fc2
Merge pull request #766 from ConnorGBrewster/fix-#489
...
Added option for tighter punctuation in types. fixes #489
2016-01-12 22:52:34 +01:00
Connor Brewster
479b69266b
Changed TypeDensity::WhiteSpace to TypeDensity::Wide
...
Changed eq_str and plus_str assignments to use a match
2016-01-12 13:42:53 -07:00
Connor Brewster
d7a3256d40
If where is on the same line as the impl, { is put on the same line fixes #650
...
factored if clause into a separate function
2016-01-11 21:26:45 -07:00
Connor Brewster
dba2d8afd5
Added option for tighter punctuation in types. fixes #489
2016-01-11 12:26:57 -07:00
Seo Sanghyeon
f9f7235c1b
Trailing commas for wildcard arms
2016-01-06 11:02:01 +09:00
Aleksey Kladov
a70b621607
add option to ignore out of line modules
2015-12-23 17:25:49 +03:00
Nick Cameron
f8cb1baadd
Add normalise_comments option.
...
So block comments are not converted to line comments
2015-12-10 09:29:03 +13:00
Bryce Van Dyk
2a430a8947
Trailing commas for match block arms
...
Attempt to implement an option for trailing commas for block based match arms (issue
173). Put in place test files to verify this behaviour.
2015-11-30 21:51:20 +13:00
Marcus Klaas
9fe3c08abc
Add option to disable (un)wrapping of match arms
2015-11-20 21:50:25 +01:00
Kevin Yeh
15ec5b2912
Fix empty body format, add fn_empty_single_line option, refactor block tests
2015-11-19 20:45:02 -06:00
Kevin Yeh
4d7de5a16e
Support single-line functions
...
By default, places functions with empty bodies on one line.
If the function has only one expression or statement that fits on one line, the 'fn_single_line' option can be used.
2015-11-19 14:23:56 -06:00
Nick Cameron
f09aa85798
Merge pull request #619 from SiegeLord/item_brace_style_1
...
Implement initial option for brace style for non-fn items.
2015-11-20 07:41:12 +13:00
Pavel Sountsov
a96a69b708
Comments.
...
- Move the option
- Add some more tests (don't pass yet)
2015-11-16 23:18:07 -08:00
Pavel Sountsov
8658774ad2
Implement initial option for brace style for non-fn items.
2015-11-15 11:55:18 -08:00
Nick Cameron
f88345c431
Merge pull request #607 from rhoot/native-newline
...
Adding a "Native" option to newline_style.
2015-11-16 08:25:22 +13:00
Johan Sköld
add37b9c49
Adds a "Native" option to newline_style.
...
By using it one will get \r\n line endings on Windows, and \n line endings
on other platforms.
2015-11-15 04:16:34 -08:00
Seo Sanghyeon
faff4bc9e8
Add verbose mode
2015-11-15 15:41:41 +09:00
Thorben Kroeger
d4be6a43e9
new config 'chain_indent'
2015-11-14 21:50:40 +01:00
Nick Cameron
b7d61254a7
Option to disable line breaking in comments
...
Set to false by default for now, since we are having a lot of problems with comments. We should set to true once we have a better algorithm.
2015-11-10 08:03:01 +13:00
Marcus Klaas
4fa0b0bc57
Print configuration options once in help message
2015-10-24 16:03:10 +02:00
Marcus Klaas
2d267b16d1
Deal with floating links in chains
2015-10-22 22:30:01 +02:00
Jonas Schievink
e68cd08935
Fix typos in config descriptions
2015-10-08 16:13:10 +02:00
Marcus Klaas
199d40fa55
Increase default function call width limit
2015-10-06 22:27:11 +02:00
Marcus Klaas
a76df6b4d9
Make listItem contain option
2015-10-04 20:40:14 +02:00
Marcus Klaas
965ea09664
Split ListTactic decision logic from write_list
2015-10-04 20:40:14 +02:00
Scyptnex
00b314618d
Refactoring configuration
2015-09-29 09:38:19 +10:00
Nick Cameron
840af4f84d
Option for putting the where clause on the same line as the function if the body is empty.
2015-09-28 08:46:05 +13:00
Nick Cameron
bc59f83f02
Use max width for function decls, etc.
...
We were using ideal width + leeway before. This means we can remove leeway from the config. We could remove ideal_width too, but I want to use it for comments.
2015-09-27 19:34:35 +13:00
Nick Cameron
b894dd8abf
Use a width heuristic for struct lits.
...
Closes #123
2015-09-26 18:25:41 +12:00
Nick Cameron
ebf64ca35d
Heuristic max width for function calls
2015-09-26 13:54:22 +12:00
Pavel Sountsov
d4108a3029
Initial implementation of hard tab indentation.
2015-09-19 10:36:45 -07:00
Marcus Klaas
e72d488281
Refactor test code
...
No longer use callbacks or thread::catch_panic; reduce stdout spew; guard against rustfmt breaking the column limit.
2015-09-18 22:34:46 +02:00
Aaron Lobb
07f7926bc2
Added help string for chains_overflow_last config parameter
2015-09-15 21:15:46 -07:00
Aaron Lobb
d773580715
Changed ConfigType trait to only return a string of variants, rather than a vec
2015-09-14 13:43:55 -07:00
Aaron Lobb
8b808de6ff
Fixed https://github.com/nrc/rustfmt/issues/291 ; added output to --help runtime option with possible config values
2015-09-14 00:29:15 -07:00
Marcus Klaas
03c660633f
Refine chain breaking heuristics
...
Don't make a single line chain when it is was multi line in the source; allow overflow of the last chain element onto the next lines without breaking the chain.
2015-09-11 00:53:01 +02:00
Christoph Burgdorf
33c5776d30
Implements struct_lit_force_multiline
...
With struct_lit_force_multiline set to true
rustfmt won't ever mangle multiple struct properties
into one line.
Fixes #253
2015-09-08 01:25:44 +02:00
Christoph Burgdorf
14a94f0bcd
Allow partial rustfmt.toml
...
With this change one can use a config file
that only specifies a subset of config keys
to overwrite. E.g. a config file that looks like this
struct_trailing_comma = "Never"
struct_lit_trailing_comma = "Never"
Fixes #255
2015-09-05 00:09:26 +02:00
Nick Cameron
fae93abbda
Support struct-like layouts for fn args
2015-09-02 09:41:08 +12:00
Nick Cameron
f81485d9d6
Rename fn_args_layout to fn_args_density
2015-09-02 08:56:37 +12:00
Nick Cameron
6ca2756a82
Merge pull request #238 from nrc/fn-decl
...
Customisation of function decls
2015-09-02 08:00:28 +12:00
Nick Cameron
8d81aa1991
Support where clauses on the same line as the function decl where it all fits on one line.
2015-09-02 07:59:54 +12:00
Sinh Pham
55fe34a00f
Format strings option https://github.com/nrc/rustfmt/issues/202
2015-09-01 08:14:52 -04:00
Nick Cameron
6216dce14e
Support where clause predicates at different indentations
2015-09-01 19:04:41 +12:00
Nick Cameron
02a01350ff
Support where predicates on the same line
2015-09-01 18:53:16 +12:00
Nick Cameron
6f3c329500
Support non-indented where clauses
2015-09-01 18:38:12 +12:00
Nick Cameron
fc2fb8be43
Support different indent styles for generics
2015-09-01 18:20:17 +12:00
Nick Cameron
0413c47a09
Support different tabbing of function args
...
(Although, frankly anything other than visual is deeply wrong).
2015-09-01 17:22:00 +12:00
Nick Cameron
89cda8d43a
Option to pack fn args on fewer lines
2015-09-01 17:06:41 +12:00