about summary refs log tree commit diff
path: root/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2015-11-25Apply ClippySeo Sanghyeon-2/+2
2015-11-23Handle multiply-referenced filesNick Cameron-2/+2
Fixes #645
2015-11-20Unwrap match arms that are simple blocksMarcus Klaas-9/+3
2015-11-15Add verbose modeSeo Sanghyeon-0/+3
2015-11-14Don't print an unnecessary newline after printing format reportMika Attila-1/+1
The Display implementation for FormatReport already prints a newline after every error. However, if the format report does not contain errors, we don't want to print an empty newline. This behavior clutters up the console output with empty lines when rustfmt is invoked multiple times (from .e.g a script or cargo-fmt). So instead of using println! to print the report, we just use print!.
2015-11-02Stdin supportJohann-0/+42
Adds support for receiving input from stdin in case no file was specified. This is useful for editor/IDE integrations and other tooling. To achieve clean output a new write-mode option called plain was added, this option is mandatory when using stdin.
2015-10-27Fix crash speculatively parsing macro arguments as expressions.Eli Friedman-6/+16
The problem is essentially that if we try to parse a token tree using a CodeMap different from the one the tree was originally parsed with, spans become nonsense. Since CodeMaps can't be cloned, we're basically forced to use the original ParseSess for additional parsing. Ideally, rustfmt would be a bit more clever and figure out how to parse macro arguments based on the definition of the macro itself, rather than just guessing that a particular token sequence looks like an expression, but this is good enough for now. Fixes #538.
2015-10-24Address some issues with multiline patterns in let statementsMarcus Klaas-0/+8
2015-10-24show rustfmt coverage!Ravi Shankar-5/+8
2015-10-23Remove dependence on rustc/rustc_driver, use syntexAlex Crichton-64/+13
Instead just parse manually with the `syntex_syntax` crate which is a clone of libsyntax on crates.io which builds on stable Rust.
2015-10-23Remove usage of many unstable featuresAlex Crichton-7/+0
This removes usage of: * PathExt * split_last * split_last_mut * catch_panic The catch_panic one was a little tricky as the ident interner needed to be cloned across threads (a little unsafely), but it should otherwise be good to go.
2015-10-19Format some patternsMarcus Klaas-1/+24
2015-10-06Increase default function call width limitMarcus Klaas-1/+0
2015-10-04Split ListTactic decision logic from write_listMarcus Klaas-2/+1
2015-10-01Fix 1-tuple regression.Tim Kuehn-0/+1
Add test to prevent future regressions.
2015-09-27Merge pull request #370 from marcusklaas/match-arm-deliningMarcus Klaas de Vries-2/+2
Improve heuristics for match arm body placement
2015-09-26Fix match arm indentation bugMarcus Klaas-2/+2
2015-09-26Changes to rustfmt sourceNick Cameron-5/+20
2015-09-26Changes to source formattingNick Cameron-2/+4
2015-09-19Add Indent::none(), remove make_indent.Pavel Sountsov-9/+13
2015-09-19Initial implementation of hard tab indentation.Pavel Sountsov-0/+74
2015-09-18Refactor test codeMarcus Klaas-73/+27
No longer use callbacks or thread::catch_panic; reduce stdout spew; guard against rustfmt breaking the column limit.
2015-09-18Split formatting function from side effectsMarcus Klaas-16/+33
This makes rustfmt more usable as a library.
2015-09-16Format macro invocationsMarcus Klaas-4/+4
2015-09-15Remove a few unnecessary `rustfmt_skip`sNick Cameron-14/+3
2015-09-11Refine chain breaking heuristicsMarcus Klaas-0/+1
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-11Implement basic chain formattingMarcus Klaas-0/+1
2015-09-10Add diff write mode https://github.com/nrc/rustfmt/issues/261Sinh Pham-0/+6
2015-09-07Merge pull request #248 from sinhpham/unicode_string_litNick Cameron-2/+3
Unicode string lit
2015-09-04code improvements suggested by clippyAndre Bogus-2/+2
2015-09-03Support unicode in string literals.Sinh Pham-2/+3
2015-09-02Support struct-like layouts for fn argsNick Cameron-3/+3
2015-08-25Format assignmentMarcus Klaas-0/+2
2015-08-20Re-jig binop formattingNick Cameron-1/+1
and misc other fixes from the reviews.
2015-08-20Handle span error with `continue`Nick Cameron-1/+4
This should be properly addressed by #184, but requires a change to the rustc parser, so this patch just works around the issue.
2015-08-20FormattingNick Cameron-2/+2
2015-08-19Add option to override single configuration lines for testsMarcus Klaas-1/+1
2015-08-19Add an option to forgo backupsMarcus Klaas-5/+20
2015-08-02Kill ChangeSet and replace remaining part by FileMapGaëtan Cassiers-15/+15
Also fix style issues Cargo update to get fixes of strings.rs (was cause of a misformatted function call).
2015-08-02Remove ChangeSet of FmtVisitorGaëtan Cassiers-4/+7
2015-08-02Separate modules and files listing of reformattingGaëtan Cassiers-2/+4
As suggested in #141 Closes #156
2015-07-25Merge pull request #147 from marcusklaas/even-more-exprNick Cameron-5/+5
Format if expressions & loops
2015-07-24Refactor some things; add extra tests.Marcus Klaas-2/+1
2015-07-23Simplify CompilerCalls implNick Cameron-33/+1
2015-07-19Format all the loops!Marcus Klaas-3/+4
2015-07-17Resolve some warningsNick Cameron-1/+1
2015-07-17Merge pull request #137 from nrc/struct-lit-optNick Cameron-0/+13
Options for formatting struct literals
2015-07-16Don't apologise if its not our fault in warningsNick Cameron-5/+25
2015-07-16Add an option to format struct lits with either block or visual indentNick Cameron-0/+13
2015-07-03Format modules into separate filesGaëtan Cassiers-5/+0