csmoe
c791a54ff4
repair break_label format
2018-06-07 11:21:52 +08:00
Nick Cameron
da30d235a4
Merge pull request #2771 from topecongiro/issue-2746
...
Fix poor formatting of impls
2018-06-06 14:38:42 +12:00
Nick Cameron
576e9af0ae
Merge pull request #2769 from topecongiro/issue-2765
...
Put each nested import on its own line
2018-06-06 14:37:25 +12:00
Seiichi Uchida
a4db62368b
Respect empty_item_single_line config option when formatting empty impls
2018-06-06 10:55:25 +09:00
Seiichi Uchida
d51b99f5d7
Put the where clause next to the closing bracket only when it is not indented
2018-06-06 10:54:40 +09:00
Seiichi Uchida
2e4376d29c
Do not put where clause on a single with multi-lined type
2018-06-06 10:46:49 +09:00
Seiichi Uchida
8d01496c9e
Remove unreachable lines
2018-06-06 10:46:18 +09:00
Seiichi Uchida
42ab258757
Put each nested import on its own line
...
while putting non-nested imports on the same line as much as possible.
2018-06-05 19:58:44 +09:00
Nick Cameron
f545dfe95e
Fix tests
2018-06-05 20:58:02 +12:00
Nick Cameron
95b4978baa
Merge pull request #2767 from topecongiro/issue-2759
...
Fix breaking code block with `#` in doc comments
2018-06-05 20:28:32 +12:00
king6cong
56a3d039ce
update rustfmt flags that should work without targets
2018-06-05 15:43:48 +08:00
Seiichi Uchida
604764abe1
Trim custom comment prefix even when we failed to format code block
2018-06-05 15:58:14 +09:00
Seiichi Uchida
1b4778d0bc
Handle code block with indented escapce character
2018-06-05 15:57:49 +09:00
Seiichi Uchida
a70213b009
Trim custom comment prefixes from code block without closing backticks
2018-06-05 15:57:03 +09:00
Nick Cameron
d9149fb52e
Merge pull request #2741 from csmoe/where_brace
...
Remove newline in empty impl
2018-06-05 18:04:22 +12:00
Seiichi Uchida
b4987d848b
Allow using mixed layout with comments
2018-06-05 13:43:01 +09:00
csmoe
faa41168a9
format exceeded comments
2018-06-05 07:35:51 +08:00
csmoe
8874c95a00
recover suppressed comma
2018-06-04 19:10:09 +08:00
csmoe
0468c134f4
snuggle where
2018-05-31 18:33:45 +08:00
csmoe
8536c288f2
suppress and compress
2018-05-31 17:58:48 +08:00
Seiichi Uchida
2f65852946
Do not insert spaces around braces with empty body or multiple lines
2018-05-30 08:44:57 +09:00
Seiichi Uchida
966fe8d705
Fix treating the delimiter right after repeat as repeat as well
2018-05-30 08:44:57 +09:00
Alex Butler
f390626778
Update rustc-ap-* -> 149 ( #2748 )
2018-05-30 08:22:49 +09:00
Alex Butler
cd925f0140
Add mercy for devs that run cargo test
without building
2018-05-29 00:38:47 +01:00
Alex Butler
5473c3fd92
Update rustc-ap-* -> 148
2018-05-28 23:41:08 +01:00
Nick Cameron
173ae0d7b9
0.8.2
2018-05-28 11:47:21 +12:00
Nick Cameron
d930617cbe
Make Range public
...
0.8.1
2018-05-28 11:30:58 +12:00
Nick Cameron
8674ab9a42
FIXME for <-
2018-05-28 11:15:15 +12:00
Nick Cameron
0a2ec411ae
Merge pull request #2739 from thibaultdelor/fixWindowsTest
...
Fix test failing on windows due to crlf
2018-05-28 10:13:09 +12:00
Nick Cameron
1d5da1011f
Merge pull request #2733 from topecongiro/issue-2727
...
Trim unnecessary whitespaces between a macro call and a semicolon
2018-05-28 10:12:23 +12:00
topecongiro
8fea1fcfe5
Add a comment to describe hack
2018-05-28 06:44:52 +09:00
Tibo
33a46581f7
Fix test failing on windows due to crlf
2018-05-27 03:20:02 +10:00
Pazzaz
f711078126
Seperate and optimize grapheme conditions
2018-05-24 21:32:01 +02:00
Pazzaz
a1d137116b
Avoid unnecessary comparisons with cur_end
2018-05-24 21:32:01 +02:00
topecongiro
eedd275cd9
Do not call format_missing_inner in a common case
...
We use `format_missing()` to extract a missing comment between a macro
(or alike) and a trailing semicolon. This commit just tries to avoid calling
`format_missing_inner` in the common case where there is no such comment.
This is a hack, ideally we should fix a possible bug in `format_missing_inner`
or refactor `visit_mac` and `rewrite_macro`, but this should suffice to fix the
issue.
2018-05-24 00:14:05 +09:00
topecongiro
5d067f16e0
Format code block with sharp prefix
...
by hiding lines with a leading `#` behind a custom comment.
2018-05-23 23:30:07 +09:00
topecongiro
f1974e2209
Handle code block in doc comment without rust prefix
2018-05-23 23:29:28 +09:00
Nick Cameron
353816c596
Merge pull request #2730 from topecongiro/issue-2704
...
Disallow combining a method call with prefix or suffix
2018-05-23 20:10:49 +12:00
topecongiro
8cb2b8e909
Cargo fmt
2018-05-23 07:22:59 +09:00
topecongiro
fbcc886338
Disallow combining a method call with prefix or suffix
2018-05-23 07:22:42 +09:00
topecongiro
a6b32d944c
Fix breaking changes from introducing AnonConst
2018-05-23 06:04:32 +09:00
Seiichi Uchida
1b3257df8b
Merge pull request #2726 from csmoe/label_break
...
Format label break
2018-05-22 07:16:05 +09:00
csmoe
64768cf932
fix label prefix
2018-05-21 22:37:55 +08:00
csmoe
150765d755
format label break
2018-05-21 13:30:07 +08: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
9a7fac63c8
Remove format_and_emit_report
from the API
...
Also changes the header/footer stuff
2018-05-21 15:09:17 +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
abb253df8b
Rationalise result and error types
2018-05-21 08:58:53 +12:00
Nick Cameron
432b1cb253
Rationalise error types
...
cc #2639
2018-05-21 08:58:53 +12:00
Nick Cameron
760af6cfc9
Make format_snippet
and format_code_block
private
...
cc #2639
2018-05-21 08:58:53 +12:00
Nick Cameron
e83c7ff005
Merge pull request #2723 from topecongiro/rustc-ap-syntax
...
Update rustc-ap-syntax
2018-05-19 11:47:36 +12:00
topecongiro
912e4bdc90
Fix breaking changes from rustc-ap-syntax
...
cc https://github.com/rust-lang/rust/pull/50045 .
2018-05-19 08:43:00 +09:00
Thomas Lively
5d56adb10c
Fix position of auto in auto trait declaration
2018-05-18 17:25:33 -04:00
Nick Cameron
2ee8b0e4c5
Remove remove_blank_lines_at_start_or_end_of_block
...
cc #1974
2018-05-18 16:56:55 +12:00
Nick Cameron
dd9c15ad01
Unstabilise unstable_features
...
cc #1974
2018-05-18 16:53:08 +12:00
Nick Cameron
a70f71610c
stabilise remove_nested_parens
and set default to true
2018-05-18 16:46:22 +12:00
Nick Cameron
8afe367510
stabilise shorthand options
...
cc #1974
2018-05-18 16:38:09 +12:00
Nick Cameron
d726492e65
Remove spaces_within_parens_and_brackets
...
cc #1974
2018-05-18 16:35:09 +12:00
Nick Cameron
7b6d2b4699
Stabilise reorder_imports and reorder_modules
2018-05-18 16:04:09 +12:00
Nick Cameron
416bc4c353
Unstabilise comments options
...
cc #1974
2018-05-18 16:02:05 +12:00
Nick Cameron
1452349966
Exit with 1 for license check in --check
mode
...
Closes #2707
2018-05-18 15:30:32 +12:00
Shotaro Yamada
d1e2b80fb9
Use saturating_sub
2018-05-15 20:41:43 +09:00
Nick Cameron
390a284851
Give a deprecation warning on rustfmt_skip
and an error on rustfmt::
other than skip
2018-05-14 18:10:46 +12:00
Nick Cameron
51f566062f
Update uses of rustfmt_skip
to rustfmt::skip
2018-05-14 16:25:10 +12:00
Nick Cameron
de950c2973
Skip on rustfmt::skip
as well as rustfmt_skip
2018-05-14 16:13:21 +12:00
Nick Cameron
7eb8bdbbd2
Format attributes with paths
2018-05-14 16:04:15 +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
Pazzaz
1c1763c7ae
Remove unnecessary use of Box in format_function_type
2018-05-12 10:53:06 +02:00
Seiichi Uchida
1b1eccc553
Fix build failure ( #2699 )
2018-05-12 10:36:34 +09:00
Nick Cameron
eca7796fb1
Replace --dump-minimal-config
and --dump-default-config
with --print-config
...
cc #1976
2018-05-11 20:43:08 +12:00
Nick Cameron
4d9de48e06
Add --check
flag.
...
cc #1976
2018-05-11 20:26:00 +12:00
Nick Cameron
798bffb8b1
--help
options
...
cc #1976
2018-05-11 20:12:16 +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
Nick Cameron
5dba81bbbf
Merge pull request #2687 from Marwes/issue_2641
...
fix: Don't insert an extra brace in macros with native newlines
2018-05-09 13:18:27 +12:00
Nick Cameron
659d0c9741
Merge pull request #2684 from topecongiro/issue-2175
...
Apply small parent heuristic only when the chain is at the beginning of the line
2018-05-09 13:16:26 +12:00
Alex Crichton
47742807f7
Ensure tests pass on the beta compiler
...
Also add a travis matrix entry for emulating the beta tests
2018-05-08 18:05:08 -07:00
Markus Westerlind
4c9ef93df7
fix: Don't insert an extra brace in macros with native newlines
...
Due to `format_snippet` formatting the input with \r\n the subtraction
would wouldn't give a length that removed the }
Fixes #2641
2018-05-08 20:34:44 +02:00
Alex Crichton
a72be170d7
Fix rustfmt tests in the Rust repo
...
Two tests were executing `cargo run` but `cargo` is not ambiently available to
execute. Instead it's best to execute the rustfmt binary directly, which is
always assembled as part of `cargo test`.
2018-05-08 07:32:00 -07:00
topecongiro
bd25c7d0f7
Cargo fmt
2018-05-08 06:25:48 +09:00
topecongiro
0ec311ee07
Apply small parent rule only when there is small offset
2018-05-08 06:25:06 +09:00
Nick Cameron
f46f4b5f66
Merge pull request #2675 from flodiebold/non-modrs-mods
...
Fix handling of modules in non_modrs_mods style
2018-05-07 11:23:14 +12:00
Nick Cameron
bd7ae5e89b
Merge pull request #2682 from topecongiro/issue-2670
...
Do not duplicate attributes on use items
2018-05-07 11:21:02 +12:00
Nick Cameron
4bbd5c4ae5
Merge pull request #2681 from topecongiro/issue-2680
...
Error on self_tests when there are lines that exceed max width
2018-05-07 11:20:33 +12:00
Florian Diebold
e65aa302d3
Turn the nonmodrs-mods test into a standard idempotence test
...
We need to skip children on foo.rs, since the parser will not find bar from that
file, but with that, the test works fine.
2018-05-06 13:08:43 +02:00
topecongiro
e59ceaf954
Do not duplicate attributes on use items
2018-05-06 17:01:14 +09:00
Florian Diebold
215baae223
Add a test for non-mod.rs mods
2018-05-06 09:58:03 +02:00
Florian Diebold
cf573e8157
Fix handling of modules in non_modrs_mods style
...
We need to keep track of the module relative to which we're resolving paths,
instead of always passing None.
Fixes #2673 .
2018-05-06 09:58:03 +02:00
topecongiro
51c07f4335
Fix up lines exceeding max width
2018-05-06 16:17:09 +09:00
topecongiro
5f05987211
Use rustfmt.toml when running self_tests
2018-05-06 16:16:58 +09:00
topecongiro
1f738ea208
Cargo fmt
2018-05-06 15:22:29 +09:00
topecongiro
f8439ce8fe
Put operands on its own line when each fits in a single line
2018-05-06 15:22:17 +09:00
topecongiro
f885039e6c
Do not overflow a long item
...
Take the first line's width of a single item into account when
trying to overflow something.
Closes #2676 .
2018-05-06 12:12:16 +09:00
Nick Cameron
17b04f181d
Merge pull request #2677 from csmoe/remove_nested_parens_opt
...
Add remove nested parens option
2018-05-06 14:01:17 +12:00
Nick Cameron
0cc4a8d848
Update rustc_ap_syntax
2018-05-06 09:57:26 +12:00
Nick Cameron
0f8029f251
Use a different env var for the test directory
2018-05-06 08:23:26 +12:00
csmoe
7c246344f8
remove nested parens option
2018-05-05 23:13:49 +08:00
Nick Cameron
4a57e79469
Merge pull request #2667 from tspiteri/width-heuristics
...
Do not scale WidthHeuristics when max_width less than 100
2018-05-04 11:46:28 +12:00
Nick Cameron
b6cd17f28a
Fix test bug (again)
2018-05-04 09:35:56 +12:00
Nick Cameron
a06caf6b17
Merge pull request #2671 from csmoe/merge_mix
...
Make imports_layout = "Mixed" addressed
2018-05-03 20:08:16 +12:00
csmoe
8c8676cd30
fix merge_mix
2018-05-03 10:26:53 +08:00
Nick Cameron
4a4916920f
Make test temp files in the Cargo target directory, if known
2018-05-03 11:14:01 +12:00
Trevor Spiteri
48df8f8dc0
Add test for width heuristics
2018-05-02 11:38:23 +02:00
Trevor Spiteri
9b36156020
Do not scale WidthHeuristics when max_width less than 100
2018-05-02 10:38:02 +02:00
Nick Cameron
36c49d703a
Merge pull request #2666 from topecongiro/issue-2634
...
Avoid flip-flopping impl items when reordering them
2018-05-02 10:28:46 +12:00
Nick Cameron
c3bdd3aa90
Merge pull request #2665 from topecongiro/issue-2647
...
Use correct one line width for list attribute
2018-05-02 10:26:49 +12:00
Nick Cameron
d8982e5efe
Suppress warning about unused attribute
2018-05-02 10:18:14 +12:00
topecongiro
43df7dcb0e
Run cargo fmt with reorder_impl_items set to true
2018-04-30 16:24:01 +09:00
topecongiro
37c216c50f
Use bytepos to compare impl items
2018-04-30 16:19:52 +09:00
topecongiro
48e193c7f6
Factor out visit_impl_items
2018-04-30 16:13:51 +09:00
topecongiro
61a401ae51
Use correct one line width for list attribute
...
Closes #2647 .
2018-04-30 15:49:32 +09:00
Nick Cameron
e554d8617d
Merge branch 'master' into imports_indent
2018-04-30 11:50:53 +12:00
Nick Cameron
1b7195695a
Merge pull request #2663 from csmoe/config_curr
...
set stdin default config path to current dir
2018-04-30 11:20:04 +12:00
Nick Cameron
ffaa6fcb0c
Merge pull request #2661 from topecongiro/issue-2645
...
Preserve comments between attribute and use item
2018-04-30 11:10:48 +12:00
Nick Cameron
af5976cf1e
Merge pull request #2659 from topecongiro/issue-2652
...
Do not add a trailing comma on array inside macro
2018-04-30 11:07:33 +12:00
Nick Cameron
dae9fb64b6
Merge pull request #2656 from topecongiro/issue-2594
...
Use consistent formatting for empty enum and struct
2018-04-30 11:06:33 +12:00
csmoe
be3be582cc
set stdin default config path to curr
2018-04-29 21:40:37 +08:00
csmoe
f7415bcea2
update self format
2018-04-29 20:53:31 +08:00
csmoe
c9cef5db17
import_indent to Block
2018-04-29 19:57:49 +08:00
Ryan Leung
fb9a5add9b
add rustc_target to dependencies ( #2660 )
2018-04-28 16:08:58 +09:00
topecongiro
0c5631e4c1
Use correct span for UseTree
2018-04-28 16:05:02 +09:00
topecongiro
a159b64b0a
Preserve comments between attribute and use item
2018-04-28 16:04:09 +09:00
topecongiro
43890cff6b
Preserve trailing comma inside array
...
Closes #2652 .
2018-04-28 15:09:54 +09:00
topecongiro
e512c19ed5
Use format_empty_struct_or_tuple over format_missing_no_indent
...
Closes #2594 .
2018-04-28 14:03:14 +09:00
topecongiro
fb0c6affa5
Use format_empty_struct_or_tuple
2018-04-28 13:59:54 +09:00
topecongiro
82d8dd2f4b
Factor out a formatting routine for empty struct and tuple
2018-04-28 13:59:03 +09:00
topecongiro
a955365459
Use a glob import for import utils
2018-04-28 13:24:05 +09:00
Nick Cameron
d19fc450c0
Merge pull request #2650 from thibaultdelor/useFailureCrate
...
Use failure crate
2018-04-27 15:14:47 +12:00
Nick Cameron
0f4ed08d0e
Harden tests to not rely on CWD
2018-04-27 11:13:05 +12:00
Tibo
e06c9c8c53
Allow io::Error
to live longer before being wrapped in a failure::Error
2018-04-26 14:39:10 +10:00
Tibo
b7df23c3d5
Replace completely std::error with failure crate
2018-04-26 13:48:48 +10:00
Tibo
5581be2616
Use failure for FormattingError
2018-04-26 12:18:30 +10:00
Tibo
efb8069cfc
Replace std::Error with failure for FormatDiff
2018-04-26 12:18:20 +10:00
Seiichi Uchida
ac8ae00625
Cargo update and clippy ( #2643 )
2018-04-25 07:21:23 +09:00
Roman Stoliar
5b5a72c840
keep auto trait
2018-04-20 17:31:31 +03:00
Nick Cameron
866900449a
Make some more stuff private
...
0.6
2018-04-20 22:10:48 +12: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
6a31741eaa
Get exit codes right
2018-04-20 14:17:56 +12:00
Nick Cameron
5194984812
Add a verbose-diff option
...
And don't print end of line characters by default in diffs
cc #2536
2018-04-20 14:02:44 +12:00
Nick Cameron
7a886e8fe5
Refactoring around write mode in main
2018-04-20 13:42:27 +12:00
Nick Cameron
a73f14aa95
Trivial refactoring in bin
2018-04-20 13:24:45 +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
61d29eb70c
Add spaces between consecutive ..
..=
2018-04-16 17:33:22 +09:00
Nick Cameron
1415a4dc23
Fix tests
2018-04-14 10:20:08 +12:00
Nick Cameron
01c1f99e39
Fallout from removing TupField
2018-04-14 10:15:39 +12:00
Nick Cameron
2cea3644fe
Merge pull request #2618 from topecongiro/issue-1174
...
Output xml header and footer only once
2018-04-12 16:56:00 +12:00
Seiichi Uchida
8b731db6ba
Output xml header and footer only once
2018-04-12 13:45:12 +09:00
Nick Cameron
55dd8f1df0
Merge pull request #2603 from topecongiro/merge-nested-imports
...
Merge imports
2018-04-12 16:40:06 +12:00
Seiichi Uchida
e58e97783e
Preserve trailing comma on macro call when using mixed layout
2018-04-12 09:54:00 +09:00
Nick Cameron
305c640553
Review changes
2018-04-11 10:50:19 +12:00
Nick Cameron
1c17dbbf74
rebasing
2018-04-11 10:46:49 +12:00
Nick Cameron
911395a451
Squash the various 'reorder imports' option into one
...
cc #2185
2018-04-11 10:46:49 +12:00
Seiichi Uchida
8820a59bd5
Resolve review comments
2018-04-10 12:36:57 +09:00
Seiichi Uchida
4a7e45ec28
Simplify UseTree::has_comment
2018-04-10 12:36:57 +09:00
Seiichi Uchida
1954513ace
Merge imports with the same prefix into a single nested import
2018-04-10 12:36:57 +09:00
Seiichi Uchida
5dd203eabe
Add merge_imports config option
2018-04-10 12:36:57 +09:00
Nick Cameron
518ece2272
Merge pull request #2612 from peterhuene/suppress-unstable-config-options
...
Suppress unstable config options by default.
2018-04-10 15:07:57 +12:00
Peter Huene
8208f8aa01
Suppress unstable config options by default.
...
This commit suppresses the output of unstable config options by default.
Users can specify the `--unstable-features` option to show the config options
that are unstable.
Fixes #2611 .
2018-04-09 12:45:56 -07:00
Nick Cameron
e784712f09
Try to fix a build regression before it happens
2018-04-09 21:07:49 +12:00
Nick Cameron
f14671131e
Make error_on_line_overflow
false by default
...
And improve docs, the error message, etc.
I think false is the better default since such errors should only occur due to a bug in Rustfmt and therefore most users should not be notified of it happening (although to be clear, it might be a 'bug' which only occurs with pathological input and therefore we won't fix it). The error has proven to be confusing and annoying in the past.
Closes #1080
2018-04-09 16:47:55 +12:00
Nick Cameron
48e5bc1988
Reorder config options
...
cc #1974
2018-04-09 16:31:53 +12:00
Nick Cameron
7822d0c921
Fix test
2018-04-09 09:54:07 +12:00
csmoe
84d3659767
update rustc syntax 91.0.0
2018-04-08 22:22:11 +08:00
Seiichi Uchida
edcc7b69eb
Cargo update ( #2602 )
...
Update `rustc-ap-syntax` to 89.0.0 and fix up breaking changes.
2018-04-06 23:09:45 +09:00
Nick Cameron
b6645e345e
Merge pull request #2601 from topecongiro/fix-merge-mess
...
Fix up merge mess
2018-04-06 15:32:05 +12:00
Seiichi Uchida
04227a7d30
Fix up merge mess
2018-04-06 10:31:57 +09:00
Nick Cameron
0a480181e8
Merge pull request #2600 from i1skn/error_on_unformatted
...
Fix error_on_unformatted and skip_children override
2018-04-06 12:41:13 +12:00
Nick Cameron
4b2160e1b2
Merge pull request #2599 from topecongiro/issue-2596
...
Use multiple lines for imports list which exceeds max width
2018-04-06 11:12:53 +12:00
Nick Cameron
a3fba04141
Merge pull request #2593 from topecongiro/issue-2455
...
Add reorder_impl_items config option
2018-04-06 11:12:11 +12:00
Ivan Sorokin
3fe2233fd3
Fix error_on_unformatted and skip_children override
...
Currently, error_on_unformatted and skip_children options
specified in the config file are discarded.
This happens because CLI options have a higher priority,
but we coerce an absence of a `bool` option to `false`.
In this scenario, an absence of a `bool` option is indistinguishable
from explicetely set as `false`. We should coerce it to `None` instead,
so it does not override the one in the config file.
2018-04-05 23:13:17 +02:00
Nick Cameron
b7ba6f70b1
Merge pull request #2576 from topecongiro/merge-imports
...
Use normalized form to format use items
2018-04-05 17:39:22 +12:00
Nick Cameron
0156fe07ac
Merge pull request #2589 from topecongiro/issue-2588
...
Do not indent or unindent inside string literal
2018-04-05 17:36:15 +12:00
Nick Cameron
a318bc887f
Merge pull request #2580 from remram44/improve-where_single_line-help
...
Improve `where_single_line` help
2018-04-05 17:34:53 +12:00
Seiichi Uchida
97ec417e74
Add trailing comma when using mixed layout with block indent
2018-04-05 13:27:42 +09:00
Seiichi Uchida
636de8313d
Put imports list on the next line if it exceeds max width
2018-04-05 13:24:18 +09:00
Seiichi Uchida
ec1907b2a4
Do not indent or unindent inside string literal
...
Closes #2588 .
2018-04-05 12:52:43 +09:00
Seiichi Uchida
89070a2244
Implement LineClasses
2018-04-05 12:52:43 +09:00
Seiichi Uchida
fa80ddf876
Reorder impl items based on its kind
...
The ordering is defined as follows:
type < cosnt < macro < method
Items that are same kind will not be reordered: that is, the item
that an user has put first comes first.
2018-04-05 12:49:16 +09:00
Seiichi Uchida
94f5a05a6a
Add reorder_impl_items config option
2018-04-05 12:49:16 +09:00
memoryleak47
d48cbedfe4
typo ( #2598 )
...
* typo
* more typos
2018-04-05 12:47:09 +09:00
Marthog
bc05621f9b
Let --dump-default-config default to stdout #2579 ( #2586 )
2018-04-01 23:15:25 +09:00
Seiichi Uchida
dec307b2fa
Merge pull request #2584 from sinkuu/cleanup
...
Misc cleanups
2018-04-01 23:14:52 +09:00
Shotaro Yamada
e2d801f11e
Do not turn spaces in the beginning of the file into a newline ( #2583 )
2018-04-01 23:09:53 +09:00
Shotaro Yamada
56e10aa6e9
Fix typo
2018-04-01 22:29:26 +09:00
Shotaro Yamada
3467b4dafe
Use ListItem::has_comment
2018-04-01 22:29:26 +09:00
Shotaro Yamada
ba792a7fa2
Remove redudant parens
2018-04-01 22:29:26 +09:00
Shotaro Yamada
71448ff3c2
Return String instead of always returing Cow::Owned
2018-04-01 22:29:26 +09:00
Shotaro Yamada
39e85281f3
Remove stray comment
...
Its pointee was removed in 04a6d16c7b
2018-04-01 22:29:26 +09:00
Shotaro Yamada
a2325375ed
Do not collect into a Vec by hand
2018-04-01 22:29:26 +09:00
Shotaro Yamada
89200f40ff
Remove unnecessary [..]
s
2018-04-01 22:29:26 +09:00
Shotaro Yamada
6b3811a358
Use Iterator methods
2018-04-01 22:29:26 +09:00
Shotaro Yamada
ed46a777c8
Use str::repeat
2018-04-01 22:29:26 +09:00
Remi Rampin
37ee9c20aa
Improve where_single_line help
2018-03-31 18:51:41 -04:00