]>
git.lizzy.rs Git - rust.git/log
topecongiro [Fri, 23 Feb 2018 16:18:53 +0000 (01:18 +0900)]
Cargo fmt
topecongiro [Fri, 23 Feb 2018 16:05:19 +0000 (01:05 +0900)]
Format lazy_static! macro
Some macros like `lazy_static!` cannot be parsed as a valid AST. Therefore, we
need to parse them manually to be able to format them. Obviously this method
will not scale, we will never be able to cover every macro in the entire
ecosystem. That being said, I think it will not hurt to be able to format macros
that are popular (such as `lazy_static!`) as long as rustfmt will not produce
broken code when the macro has syntax that is not expected.
topecongiro [Fri, 23 Feb 2018 16:04:54 +0000 (01:04 +0900)]
Update a test for lazy_static!
topecongiro [Fri, 23 Feb 2018 16:04:36 +0000 (01:04 +0900)]
Add a test for formatting lazy_static!
Nick Cameron [Fri, 23 Feb 2018 00:39:56 +0000 (13:39 +1300)]
Merge pull request #2480 from topecongiro/issue-2476
Avoid drifting macro body which is unformattable
topecongiro [Fri, 23 Feb 2018 00:07:35 +0000 (09:07 +0900)]
Cargo clippy
topecongiro [Thu, 22 Feb 2018 23:14:22 +0000 (08:14 +0900)]
Cargo fmt and update a test
topecongiro [Thu, 22 Feb 2018 23:13:57 +0000 (08:13 +0900)]
Call wrap_str to make sure that the formatting macro body worked
topecongiro [Thu, 22 Feb 2018 23:12:48 +0000 (08:12 +0900)]
Use multiple lines for function calls with 0 arg which exceeds max width
e.g.
foo(
)
topecongiro [Thu, 22 Feb 2018 23:11:10 +0000 (08:11 +0900)]
Continue formatting function calls even if it does not fit in a single line
We may be able to format it using multiple lines.
topecongiro [Thu, 22 Feb 2018 23:10:17 +0000 (08:10 +0900)]
Update tests for #2438 and #2476
topecongiro [Thu, 22 Feb 2018 23:08:12 +0000 (08:08 +0900)]
Remove macros.rs
Nick Cameron [Wed, 21 Feb 2018 07:41:20 +0000 (20:41 +1300)]
Merge pull request #2478 from csmoe/explict-version-info
Explict version info
csmoe [Wed, 21 Feb 2018 05:15:04 +0000 (13:15 +0800)]
Merge branch 'explict-version-info' of https://github.com/csmoe/rustfmt into explict-version-info
csmoe [Wed, 21 Feb 2018 05:13:39 +0000 (13:13 +0800)]
option_env and commit_info
csmoe [Wed, 21 Feb 2018 03:42:29 +0000 (11:42 +0800)]
option_env
Nick Cameron [Wed, 21 Feb 2018 03:29:45 +0000 (16:29 +1300)]
Merge pull request #2477 from davidalber/unignore-configuration-snippet-tests
Removing ignore attribute
David Alber [Wed, 21 Feb 2018 02:47:38 +0000 (18:47 -0800)]
Removing ignore attribute
Nick Cameron [Tue, 20 Feb 2018 22:53:23 +0000 (11:53 +1300)]
Merge pull request #2471 from topecongiro/issue-2470
Return the original snippet if the attribute contains invalid syntax
Nick Cameron [Tue, 20 Feb 2018 22:52:46 +0000 (11:52 +1300)]
Merge pull request #2472 from davidalber/fix-reorder-extern-crates-in-group-examples
Update `reorder_extern_crates*` Configuration.md snippets
David Alber [Tue, 20 Feb 2018 06:20:37 +0000 (22:20 -0800)]
Modifying `reorder_extern_crates` example to show effect on groups
David Alber [Mon, 19 Feb 2018 07:33:45 +0000 (23:33 -0800)]
Fixing the documentation for `reorder_extern_crates_in_group`
Seiichi Uchida [Tue, 20 Feb 2018 05:53:28 +0000 (14:53 +0900)]
Merge pull request #2469 from davidalber/fix-struct-lit-single-line-config-snippet
Using shorter example for `struct_lit_single_line` option
topecongiro [Tue, 20 Feb 2018 05:48:46 +0000 (14:48 +0900)]
Return the original snippet if the attribute contains invalid syntax
This allows us to keep formatting the macro def with attributes that become
invalid syntax when the `$` is replaced with `z`, e.g. `#[doc = $expr]`.
csmoe [Mon, 19 Feb 2018 09:17:27 +0000 (17:17 +0800)]
explict version informations
David Alber [Mon, 19 Feb 2018 07:17:36 +0000 (23:17 -0800)]
Using shorter example for `struct_lit_single_line` option
Nick Cameron [Mon, 19 Feb 2018 05:42:47 +0000 (18:42 +1300)]
Merge pull request #2468 from topecongiro/perf
Apply optimization suggested by perf
Nick Cameron [Mon, 19 Feb 2018 05:37:59 +0000 (18:37 +1300)]
Merge pull request #2467 from topecongiro/issue-2466
Skip formatting macro_rules! that are not using {}
topecongiro [Mon, 19 Feb 2018 05:08:33 +0000 (14:08 +0900)]
Skip formatting macro_rules! that are not using {}
topecongiro [Mon, 19 Feb 2018 03:50:50 +0000 (12:50 +0900)]
Use push-approach over format! in rewrite_segment
topecongiro [Mon, 19 Feb 2018 03:50:39 +0000 (12:50 +0900)]
Clean up
topecongiro [Mon, 19 Feb 2018 03:47:54 +0000 (12:47 +0900)]
Use Indent::to_string_with_newline to avoid unnecessary allocation
topecongiro [Mon, 19 Feb 2018 03:41:43 +0000 (12:41 +0900)]
Use SnippetProvider to implement SpanUtils over CodeMap
`SnippetProvider::span_to_snippet` avoids allocating a `String` so it is more
efficient than `CodeMap::span_to_snippet`.
topecongiro [Mon, 19 Feb 2018 03:36:36 +0000 (12:36 +0900)]
Avoid running lookup_line_range when file_lines are not specified
topecongiro [Sun, 18 Feb 2018 09:22:06 +0000 (18:22 +0900)]
Avoid allocating small strings in combine_strs_with_missing_comments
topecongiro [Sun, 18 Feb 2018 09:18:07 +0000 (18:18 +0900)]
Avoid using pretty printer if possible
Setting a pretty printer adds noticeable overhead.
We can replace the usage in `ast:Lifetime::rewrite` by simply converting `Ident`
to string.
We can do the same thing for a macro path as long as it is not nested, which
should hold for most cases.
topecongiro [Sun, 18 Feb 2018 09:13:46 +0000 (18:13 +0900)]
Do not inspect code for issues or todos when not required
topecongiro [Sun, 18 Feb 2018 09:11:38 +0000 (18:11 +0900)]
Use debug_assert_eq! to avoid comparing PathBuf on release
Comparing `PathBuf` adds noticeable overhead, avoid it in release build.
topecongiro [Sun, 18 Feb 2018 09:08:21 +0000 (18:08 +0900)]
Replace lookup_char_pos with lookup_line
`lookup_char_pos` wastes time on fetching unused information. We only need a
`FileMap` and line numbers, so `lookup_line` is enough.
Nick Cameron [Sun, 18 Feb 2018 22:45:49 +0000 (11:45 +1300)]
Merge pull request #2465 from karyon/fix_2346
Fix #2346: empty comments should not have any trailing space added
Nick Cameron [Sun, 18 Feb 2018 20:13:52 +0000 (09:13 +1300)]
Merge pull request #2461 from topecongiro/reorder-mod
Refactoring: add `reorder` modules
Nick Cameron [Sun, 18 Feb 2018 19:45:21 +0000 (08:45 +1300)]
Merge pull request #2464 from topecongiro/beginning-vert
Format a match arm with the beginning vertical bar
Johannes Linke [Sun, 18 Feb 2018 11:47:42 +0000 (12:47 +0100)]
Fix #2346: empty comments should not have any trailing space added
topecongiro [Sun, 18 Feb 2018 01:31:11 +0000 (10:31 +0900)]
Format a match arm with the beginning vertical bar
Seiichi Uchida [Sun, 18 Feb 2018 00:35:30 +0000 (09:35 +0900)]
Merge pull request #2463 from Razican/typo_fix
Fixed small typo in configuration help
Razican [Sat, 17 Feb 2018 20:00:26 +0000 (21:00 +0100)]
Fixed small typo in configuration help
Seiichi Uchida [Sat, 17 Feb 2018 18:00:59 +0000 (03:00 +0900)]
Add TODO
Seiichi Uchida [Sat, 17 Feb 2018 17:54:54 +0000 (02:54 +0900)]
Get rid of macro
Seiichi Uchida [Sat, 17 Feb 2018 17:06:29 +0000 (02:06 +0900)]
Rename fns
topecongiro [Sat, 17 Feb 2018 16:36:02 +0000 (01:36 +0900)]
Get rid of format_imports
topecongiro [Sat, 17 Feb 2018 16:21:58 +0000 (01:21 +0900)]
Move reorder-related stuffs in visitor mod to reorder mod
topecongiro [Sat, 17 Feb 2018 16:11:43 +0000 (01:11 +0900)]
Move rewrite_mod to the items module
topecongiro [Sat, 17 Feb 2018 16:06:54 +0000 (01:06 +0900)]
Add a reorder module
Seiichi Uchida [Sat, 17 Feb 2018 07:57:08 +0000 (16:57 +0900)]
Merge pull request #2460 from matklad/simple-ci
Simplify CI exaple in the readme
Aleksey Kladov [Sat, 17 Feb 2018 07:47:54 +0000 (10:47 +0300)]
Simplify CI exaple in the readme
rustfmt-preview is now in stable
Seiichi Uchida [Sat, 17 Feb 2018 07:14:39 +0000 (16:14 +0900)]
Merge pull request #2421 from brotzeit/clippy
apply some clippy suggestions
Seiichi Uchida [Sat, 17 Feb 2018 07:14:05 +0000 (16:14 +0900)]
Merge pull request #2454 from radix/issue-2446
Don't generate V: { f: u8, // comment }
Christopher Armstrong [Sat, 17 Feb 2018 03:52:08 +0000 (21:52 -0600)]
only wrap on trailing comments, allow /* */ comments in-line
Christopher Armstrong [Fri, 16 Feb 2018 20:14:02 +0000 (14:14 -0600)]
use contains_comment instead of an ad-hoc check for "//"
Christopher Armstrong [Fri, 16 Feb 2018 20:09:41 +0000 (14:09 -0600)]
hacky solution that makes the tests pass but should really be better
Christopher Armstrong [Thu, 15 Feb 2018 22:03:29 +0000 (16:03 -0600)]
test case for issue #2446
Nick Cameron [Fri, 16 Feb 2018 19:01:25 +0000 (08:01 +1300)]
Merge pull request #2453 from muja/patch-1
Fix typo "carfo" -> "cargo" in changelog.
Danyel [Fri, 16 Feb 2018 17:53:34 +0000 (18:53 +0100)]
Fix typo "carfo" -> "cargo" in changelog.
Nick Cameron [Fri, 16 Feb 2018 05:08:27 +0000 (18:08 +1300)]
Merge pull request #2450 from topecongiro/issue-37
Preserve trailing spaces in doc comments even when options are set
Seiichi Uchida [Fri, 16 Feb 2018 01:14:06 +0000 (10:14 +0900)]
Preserve trailing spaces in doc comments even when options are set
Closes #37.
Nick Cameron [Fri, 16 Feb 2018 01:08:27 +0000 (14:08 +1300)]
Merge pull request #2448 from jonathanmorley/patch-1
Rust 1.24 released, rustfmt now works on stable
Nick Cameron [Fri, 16 Feb 2018 01:07:29 +0000 (14:07 +1300)]
Merge pull request #2443 from topecongiro/skip-children
Do not try to parse external modules when skipping children
Nick Cameron [Fri, 16 Feb 2018 00:51:37 +0000 (13:51 +1300)]
Merge pull request #2436 from topecongiro/markdown-spaces
Preserve trailing two whitespace in comments
Nick Cameron [Thu, 15 Feb 2018 20:52:20 +0000 (09:52 +1300)]
Merge pull request #2449 from radix/patch-1
IRC channel is now #rust-dev-tools
Christopher Armstrong [Thu, 15 Feb 2018 20:47:49 +0000 (14:47 -0600)]
IRC channel is now #rust-dev-tools
Also specifically mention the IRC network (irc.mozilla.org) that the channel is on.
Jonathan Morley [Thu, 15 Feb 2018 19:35:45 +0000 (14:35 -0500)]
Rust 1.24 released, rustfmt now works on stable
Seiichi Uchida [Thu, 15 Feb 2018 13:48:06 +0000 (22:48 +0900)]
Do not try to parse external modules when skipping children
Seiichi Uchida [Thu, 15 Feb 2018 13:47:32 +0000 (22:47 +0900)]
Add rustfmt_skip to a test with long string
topecongiro [Thu, 15 Feb 2018 07:41:47 +0000 (16:41 +0900)]
Preserve two or more trailing spaces in doc comment
rustdoc treats two or more trailing spaces as a line break.
topecongiro [Thu, 15 Feb 2018 07:34:22 +0000 (16:34 +0900)]
Preserve trailing whitespaces only for doc comment
Nick Cameron [Thu, 15 Feb 2018 02:21:44 +0000 (15:21 +1300)]
Merge pull request #2086 from jugglerchris/difflines_mode
Add a new "modified lines" write mode.
Nick Cameron [Thu, 15 Feb 2018 01:40:38 +0000 (14:40 +1300)]
Merge pull request #2422 from davidalber/travis-config-badge
Proposal: add badge for Travis CI example status
Nick Cameron [Thu, 15 Feb 2018 01:18:21 +0000 (14:18 +1300)]
Merge pull request #2441 from topecongiro/issue-2438
Return `None` when format_code_block may have failed
Nick Cameron [Thu, 15 Feb 2018 01:17:39 +0000 (14:17 +1300)]
Merge pull request #2428 from PSeitz/master
scale WidthHeuristics by max_width
David Alber [Thu, 8 Feb 2018 00:47:23 +0000 (16:47 -0800)]
Adding badge and explanation for Travis CI example status
brotzeit [Wed, 14 Feb 2018 10:05:34 +0000 (11:05 +0100)]
apply some clippy suggestions
topecongiro [Tue, 13 Feb 2018 20:10:43 +0000 (05:10 +0900)]
Return None when format_code_block may have failed
Nick Cameron [Tue, 13 Feb 2018 23:10:08 +0000 (12:10 +1300)]
Merge pull request #2440 from topecongiro/issue-2439
Disable formatting macro-def if args do not fit on one line
Nick Cameron [Tue, 13 Feb 2018 23:03:21 +0000 (12:03 +1300)]
Merge pull request #2435 from davidalber/fix-option-typo
Fixing command-line option name
Nick Cameron [Tue, 13 Feb 2018 22:48:09 +0000 (11:48 +1300)]
Merge pull request #2187 from brotzeit/master
don't print verbose output when formatting with stdin
topecongiro [Tue, 13 Feb 2018 19:00:26 +0000 (04:00 +0900)]
Disable formatting macro-def if args do not fit on one line
Pascal Seitz [Sun, 11 Feb 2018 18:44:47 +0000 (19:44 +0100)]
scale WidthHeuristics by max_width
scale WidthHeuristics by max_width
Seiichi Uchida [Tue, 13 Feb 2018 09:27:54 +0000 (18:27 +0900)]
Preserve trailing two whitespace in comments
Closes #2434.
David Alber [Tue, 13 Feb 2018 05:48:57 +0000 (21:48 -0800)]
Fixing command-line option name
Chris Emerson [Mon, 12 Feb 2018 23:09:07 +0000 (23:09 +0000)]
Update comment to say that Modified is for internal use only.
Chris Emerson [Mon, 12 Feb 2018 23:07:46 +0000 (23:07 +0000)]
Update after review comments.
Chris Emerson [Mon, 12 Feb 2018 22:58:50 +0000 (22:58 +0000)]
Move the modified test files to the new location.
Chris Emerson [Mon, 12 Feb 2018 22:43:37 +0000 (22:43 +0000)]
Merge remote-tracking branch 'origin/master' into difflines_mode
Nick Cameron [Mon, 12 Feb 2018 21:11:04 +0000 (10:11 +1300)]
Merge pull request #2409 from davidalber/configuration-check-opt-out
Skipping formatting of some configuration snippets
David Alber [Sat, 3 Feb 2018 18:55:50 +0000 (10:55 -0800)]
Formatting snippets without configuration option marked as skip
brotzeit [Mon, 12 Feb 2018 11:58:38 +0000 (12:58 +0100)]
don't print verbose output when formatting with stdin
Seiichi Uchida [Mon, 12 Feb 2018 09:37:37 +0000 (18:37 +0900)]
Merge pull request #2432 from davidalber/remove-unused-import
Removing unused import
Seiichi Uchida [Mon, 12 Feb 2018 09:36:07 +0000 (18:36 +0900)]
Merge pull request #2433 from davidalber/unhork-snippet-tests
Fixing path to Configurations.md
David Alber [Mon, 12 Feb 2018 05:43:35 +0000 (21:43 -0800)]
Fixing path to Configurations.md
Issue #2419 changed the directory in which
`configuration_snippet_tests` runs, which broke the test. Since the
test is currently annotated with `#[ignore]`, the break wasn't
caught before merge.
David Alber [Mon, 12 Feb 2018 05:15:06 +0000 (21:15 -0800)]
Removing unused import