]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAvoid using pretty printer if possible
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.

6 years agoDo not inspect code for issues or todos when not required
topecongiro [Sun, 18 Feb 2018 09:13:46 +0000 (18:13 +0900)]
Do not inspect code for issues or todos when not required

6 years agoUse debug_assert_eq! to avoid comparing PathBuf on release
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.

6 years agoReplace lookup_char_pos with lookup_line
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.

6 years agoMerge pull request #2465 from karyon/fix_2346
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

6 years agoMerge pull request #2461 from topecongiro/reorder-mod
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

6 years agoMerge pull request #2464 from topecongiro/beginning-vert
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

6 years agoFix #2346: empty comments should not have any trailing space added
Johannes Linke [Sun, 18 Feb 2018 11:47:42 +0000 (12:47 +0100)]
Fix #2346: empty comments should not have any trailing space added

6 years agoFormat a match arm with the beginning vertical bar
topecongiro [Sun, 18 Feb 2018 01:31:11 +0000 (10:31 +0900)]
Format a match arm with the beginning vertical bar

6 years agoMerge pull request #2463 from Razican/typo_fix
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

6 years agoFixed small typo in configuration help
Razican [Sat, 17 Feb 2018 20:00:26 +0000 (21:00 +0100)]
Fixed small typo in configuration help

6 years agoAdd TODO
Seiichi Uchida [Sat, 17 Feb 2018 18:00:59 +0000 (03:00 +0900)]
Add TODO

6 years agoGet rid of macro
Seiichi Uchida [Sat, 17 Feb 2018 17:54:54 +0000 (02:54 +0900)]
Get rid of macro

6 years agoRename fns
Seiichi Uchida [Sat, 17 Feb 2018 17:06:29 +0000 (02:06 +0900)]
Rename fns

6 years agoGet rid of format_imports
topecongiro [Sat, 17 Feb 2018 16:36:02 +0000 (01:36 +0900)]
Get rid of format_imports

6 years agoMove reorder-related stuffs in visitor mod to reorder mod
topecongiro [Sat, 17 Feb 2018 16:21:58 +0000 (01:21 +0900)]
Move reorder-related stuffs in visitor mod to reorder mod

6 years agoMove rewrite_mod to the items module
topecongiro [Sat, 17 Feb 2018 16:11:43 +0000 (01:11 +0900)]
Move rewrite_mod to the items module

6 years agoAdd a reorder module
topecongiro [Sat, 17 Feb 2018 16:06:54 +0000 (01:06 +0900)]
Add a reorder module

6 years agoMerge pull request #2460 from matklad/simple-ci
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

6 years agoSimplify 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

6 years agoMerge pull request #2421 from brotzeit/clippy
Seiichi Uchida [Sat, 17 Feb 2018 07:14:39 +0000 (16:14 +0900)]
Merge pull request #2421 from brotzeit/clippy

apply some clippy suggestions

6 years agoMerge pull request #2454 from radix/issue-2446
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 }

6 years agoonly wrap on trailing comments, allow /* */ comments in-line
Christopher Armstrong [Sat, 17 Feb 2018 03:52:08 +0000 (21:52 -0600)]
only wrap on trailing comments, allow /* */ comments in-line

6 years agouse contains_comment instead of an ad-hoc check for "//"
Christopher Armstrong [Fri, 16 Feb 2018 20:14:02 +0000 (14:14 -0600)]
use contains_comment instead of an ad-hoc check for "//"

6 years agohacky solution that makes the tests pass but should really be better
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

6 years agotest case for issue #2446
Christopher Armstrong [Thu, 15 Feb 2018 22:03:29 +0000 (16:03 -0600)]
test case for issue #2446

6 years agoMerge pull request #2453 from muja/patch-1
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.

6 years agoFix typo "carfo" -> "cargo" in changelog.
Danyel [Fri, 16 Feb 2018 17:53:34 +0000 (18:53 +0100)]
Fix typo "carfo" -> "cargo" in changelog.

6 years agoMerge pull request #2450 from topecongiro/issue-37
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

6 years agoPreserve 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.

6 years agoMerge pull request #2448 from jonathanmorley/patch-1
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

6 years agoMerge pull request #2443 from topecongiro/skip-children
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

6 years agoMerge pull request #2436 from topecongiro/markdown-spaces
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

6 years agoMerge pull request #2449 from radix/patch-1
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

6 years agoIRC 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.

6 years agoRust 1.24 released, rustfmt now works on stable
Jonathan Morley [Thu, 15 Feb 2018 19:35:45 +0000 (14:35 -0500)]
Rust 1.24 released, rustfmt now works on stable

6 years agoDo not try to parse external modules when skipping children
Seiichi Uchida [Thu, 15 Feb 2018 13:48:06 +0000 (22:48 +0900)]
Do not try to parse external modules when skipping children

6 years agoAdd rustfmt_skip to a test with long string
Seiichi Uchida [Thu, 15 Feb 2018 13:47:32 +0000 (22:47 +0900)]
Add rustfmt_skip to a test with long string

6 years agoPreserve two or more trailing spaces in doc comment
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.

6 years agoPreserve trailing whitespaces only for doc comment
topecongiro [Thu, 15 Feb 2018 07:34:22 +0000 (16:34 +0900)]
Preserve trailing whitespaces only for doc comment

6 years agoMerge pull request #2086 from jugglerchris/difflines_mode
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.

6 years agoMerge pull request #2422 from davidalber/travis-config-badge
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

6 years agoMerge pull request #2441 from topecongiro/issue-2438
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

6 years agoMerge pull request #2428 from PSeitz/master
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

6 years agoAdding badge and explanation for Travis CI example status
David Alber [Thu, 8 Feb 2018 00:47:23 +0000 (16:47 -0800)]
Adding badge and explanation for Travis CI example status

6 years agoapply some clippy suggestions
brotzeit [Wed, 14 Feb 2018 10:05:34 +0000 (11:05 +0100)]
apply some clippy suggestions

6 years agoReturn None when format_code_block may have failed
topecongiro [Tue, 13 Feb 2018 20:10:43 +0000 (05:10 +0900)]
Return None when format_code_block may have failed

6 years agoMerge pull request #2440 from topecongiro/issue-2439
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

6 years agoMerge pull request #2435 from davidalber/fix-option-typo
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

6 years agoMerge pull request #2187 from brotzeit/master
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

6 years agoDisable formatting macro-def if args do not fit on one line
topecongiro [Tue, 13 Feb 2018 19:00:26 +0000 (04:00 +0900)]
Disable formatting macro-def if args do not fit on one line

6 years agoscale WidthHeuristics by max_width
Pascal Seitz [Sun, 11 Feb 2018 18:44:47 +0000 (19:44 +0100)]
scale WidthHeuristics by max_width

scale WidthHeuristics by max_width

6 years agoPreserve trailing two whitespace in comments
Seiichi Uchida [Tue, 13 Feb 2018 09:27:54 +0000 (18:27 +0900)]
Preserve trailing two whitespace in comments

Closes #2434.

6 years agoFixing command-line option name
David Alber [Tue, 13 Feb 2018 05:48:57 +0000 (21:48 -0800)]
Fixing command-line option name

6 years agoUpdate comment to say that Modified is for internal use only.
Chris Emerson [Mon, 12 Feb 2018 23:09:07 +0000 (23:09 +0000)]
Update comment to say that Modified is for internal use only.

6 years agoUpdate after review comments.
Chris Emerson [Mon, 12 Feb 2018 23:07:46 +0000 (23:07 +0000)]
Update after review comments.

6 years agoMove the modified test files to the new location.
Chris Emerson [Mon, 12 Feb 2018 22:58:50 +0000 (22:58 +0000)]
Move the modified test files to the new location.

6 years agoMerge remote-tracking branch 'origin/master' into difflines_mode
Chris Emerson [Mon, 12 Feb 2018 22:43:37 +0000 (22:43 +0000)]
Merge remote-tracking branch 'origin/master' into difflines_mode

6 years agoMerge pull request #2409 from davidalber/configuration-check-opt-out
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

6 years agoFormatting snippets without configuration option marked as skip
David Alber [Sat, 3 Feb 2018 18:55:50 +0000 (10:55 -0800)]
Formatting snippets without configuration option marked as skip

6 years agodon't print verbose output when formatting with stdin
brotzeit [Mon, 12 Feb 2018 11:58:38 +0000 (12:58 +0100)]
don't print verbose output when formatting with stdin

6 years agoMerge pull request #2432 from davidalber/remove-unused-import
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

6 years agoMerge pull request #2433 from davidalber/unhork-snippet-tests
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

6 years agoFixing 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.

6 years agoRemoving unused import
David Alber [Mon, 12 Feb 2018 05:15:06 +0000 (21:15 -0800)]
Removing unused import

6 years agoMerge pull request #2431 from davidalber/fix-indent-style-control-flow-snippet
Nick Cameron [Sun, 11 Feb 2018 23:31:47 +0000 (12:31 +1300)]
Merge pull request #2431 from davidalber/fix-indent-style-control-flow-snippet

Fixing `indent_style` control flow examples

6 years agoMerge pull request #2419 from topecongiro/core
Nick Cameron [Sun, 11 Feb 2018 23:15:49 +0000 (12:15 +1300)]
Merge pull request #2419 from topecongiro/core

Separate rustfmt into multiple crates

6 years agoFixing control flow examples
David Alber [Sun, 11 Feb 2018 22:48:45 +0000 (14:48 -0800)]
Fixing  control flow examples

6 years agoFix appveyor
Seiichi Uchida [Wed, 7 Feb 2018 14:57:37 +0000 (23:57 +0900)]
Fix appveyor

6 years agoPub use Config and Summary
Seiichi Uchida [Wed, 7 Feb 2018 14:15:00 +0000 (23:15 +0900)]
Pub use Config and Summary

6 years agoCargo update
topecongiro [Wed, 7 Feb 2018 13:51:14 +0000 (22:51 +0900)]
Cargo update

6 years agoCreate git-rustfmt crate
topecongiro [Wed, 7 Feb 2018 13:49:56 +0000 (22:49 +0900)]
Create git-rustfmt crate

6 years agoCreate rustfmt-format-diff crate
topecongiro [Wed, 7 Feb 2018 13:49:43 +0000 (22:49 +0900)]
Create rustfmt-format-diff crate

6 years agoCreate rustfmt-bin crate
topecongiro [Wed, 7 Feb 2018 13:49:26 +0000 (22:49 +0900)]
Create rustfmt-bin crate

6 years agoCreate cargo-fmt crate
topecongiro [Wed, 7 Feb 2018 13:49:10 +0000 (22:49 +0900)]
Create cargo-fmt crate

6 years agoCreate rustfmt_config crate
topecongiro [Wed, 7 Feb 2018 13:48:52 +0000 (22:48 +0900)]
Create rustfmt_config crate

6 years agoCreate rustfmt_core crate
topecongiro [Wed, 7 Feb 2018 13:48:05 +0000 (22:48 +0900)]
Create rustfmt_core crate

6 years agoMerge pull request #2417 from topecongiro/issue-2415
Nick Cameron [Tue, 6 Feb 2018 08:23:14 +0000 (21:23 +1300)]
Merge pull request #2417 from topecongiro/issue-2415

Avoid orphan in chain with punctuation

6 years agoMerge pull request #2416 from topecongiro/eshell
Nick Cameron [Tue, 6 Feb 2018 08:22:18 +0000 (21:22 +1300)]
Merge pull request #2416 from topecongiro/eshell

Explicitly disable colored output when it is not supported

6 years agoAvoid orphan in chain with punctuation
topecongiro [Tue, 6 Feb 2018 00:36:29 +0000 (09:36 +0900)]
Avoid orphan in chain with punctuation

6 years agoExplicitly disable colored output when it is not supported
topecongiro [Tue, 6 Feb 2018 00:29:00 +0000 (09:29 +0900)]
Explicitly disable colored output when it is not supported

6 years agoMerge pull request #2393 from RReverser/macro_rules
Seiichi Uchida [Mon, 5 Feb 2018 00:56:26 +0000 (09:56 +0900)]
Merge pull request #2393 from RReverser/macro_rules

Format stable macro_rules

6 years agoAdd a test for #2208
topecongiro [Sun, 4 Feb 2018 23:38:53 +0000 (08:38 +0900)]
Add a test for #2208

Closes #2208.

6 years agoMerge pull request #2412 from topecongiro/issue-2399
Nick Cameron [Sun, 4 Feb 2018 22:28:58 +0000 (11:28 +1300)]
Merge pull request #2412 from topecongiro/issue-2399

Do not reorder items with '#[macro_use]'

6 years agoMerge pull request #2413 from topecongiro/issue-2401
Nick Cameron [Sun, 4 Feb 2018 19:44:21 +0000 (08:44 +1300)]
Merge pull request #2413 from topecongiro/issue-2401

Use correct offset when unindenting code block

6 years agocargo run cargo-fmt
Ingvar Stepanyan [Sun, 4 Feb 2018 12:09:03 +0000 (12:09 +0000)]
cargo run cargo-fmt

Reformat codebase with current version to pass self_tests (formats macros without repetitions).

6 years agoExtract branch rewrite function
Ingvar Stepanyan [Tue, 30 Jan 2018 18:19:47 +0000 (18:19 +0000)]
Extract branch rewrite function

6 years agoFormat
Ingvar Stepanyan [Tue, 30 Jan 2018 17:24:28 +0000 (17:24 +0000)]
Format

6 years agoMove ; between macro branches to a separator
Ingvar Stepanyan [Tue, 30 Jan 2018 17:14:13 +0000 (17:14 +0000)]
Move ; between macro branches to a separator

6 years agoFix comment handling in macros
Ingvar Stepanyan [Tue, 30 Jan 2018 17:05:31 +0000 (17:05 +0000)]
Fix comment handling in macros

6 years agoComments WIP
Ingvar Stepanyan [Mon, 29 Jan 2018 10:15:18 +0000 (10:15 +0000)]
Comments WIP

6 years agoKeep delimiter as part of macro args list
Ingvar Stepanyan [Sun, 28 Jan 2018 19:08:09 +0000 (19:08 +0000)]
Keep delimiter as part of macro args list

6 years agoAdd repetition example
Ingvar Stepanyan [Thu, 25 Jan 2018 14:20:17 +0000 (14:20 +0000)]
Add repetition example

6 years agoOmit newline for empty macro branches
Ingvar Stepanyan [Thu, 25 Jan 2018 14:12:18 +0000 (14:12 +0000)]
Omit newline for empty macro branches

6 years agoOptimise common `=> {{` macro pattern
Ingvar Stepanyan [Thu, 25 Jan 2018 14:06:37 +0000 (14:06 +0000)]
Optimise common `=> {{` macro pattern

6 years agoRevert comments
Ingvar Stepanyan [Thu, 25 Jan 2018 13:30:23 +0000 (13:30 +0000)]
Revert comments

6 years agoSupport compact macros 2.0 representation
Ingvar Stepanyan [Thu, 25 Jan 2018 13:28:55 +0000 (13:28 +0000)]
Support compact macros 2.0 representation

6 years agoUpdate some macro tests
Ingvar Stepanyan [Wed, 24 Jan 2018 19:25:57 +0000 (19:25 +0000)]
Update some macro tests

6 years agoAdd macro_rules tests
Ingvar Stepanyan [Wed, 24 Jan 2018 19:09:49 +0000 (19:09 +0000)]
Add macro_rules tests

6 years agoInitial support for macros 1.1
Ingvar Stepanyan [Wed, 24 Jan 2018 18:21:01 +0000 (18:21 +0000)]
Initial support for macros 1.1