Commit Graph

13 Commits

Author SHA1 Message Date
Sebastian Blunt
235f33b230
Make tests fail if rustfmt encounters an error
Previously tests would not fail if they encountered an error such as
LineOverflow or TrailingWhitespace. Making the tests error out will fix
this mismatch between running rustfmt for real and running the tests.

This also modifies all tests that previously contained errors so that
they no longer contain errors (in almost all of the tests this is
accomplished by setting error_on_line_overflow = false).
2017-02-19 19:57:02 +01:00
Nick Cameron
1f3100d7bb Make string lit formatting fallible
This allows expressions containing string lits to wrap their content

Fixes #1282
2017-01-27 08:04:52 +13:00
Nick Cameron
7ac354fd09 Don't be so aggressie about line-breaking strings (#911)
We will no longer break in the middle of words, only at whitespace or punctuation.

This means we sometimes over-run, but that seems better than some of the bad splits we see.

Closes #369
2016-04-11 20:45:47 +02:00
Nick Cameron
02302d2800 Don't reformat strings if we don't have to.
Specifically if no line exceeds the allowed width and we aren't moving the string to a new offset
2016-01-28 19:14:08 +13:00
Marcus Klaas
1e80fd2dcd Prevent incorrect backslash removal in strings 2015-12-25 18:50:40 +01:00
Marcus Klaas
8cccf45d43 Prevent backslash stripping in string literals 2015-12-12 16:25:01 +01:00
Marcus Klaas
9734bd05af Add regression test for backslash stripping 2015-12-02 21:03:41 +01:00
Marcus Klaas
7f576b0602 General cleanup after rebase 2015-09-11 00:53:21 +02:00
Sinh Pham
61f642f6f8 Support unicode in string literals. 2015-09-03 23:41:25 -04:00
Marcus Klaas
1ae2d417b8 Remove faulty shortcut in rewrite_string_lit
Rustfmt would leave the literal unchanged when it did not exceed the column limit in its original position, not considering its position after formatting.
2015-09-01 20:42:07 +02:00
Marcus Klaas
120fd2426e Format assignment 2015-08-25 21:43:13 +02:00
Léo Stefanesco
8b78568388 Add test for raw strings 2015-08-22 21:20:31 +02:00
Marcus Klaas
963eafe94a Add tests for string literal formatting 2015-06-15 21:37:27 +02:00