Commit Graph

1337 Commits

Author SHA1 Message Date
Jeremy Wazny
7297bc320f Limit when we emit a trailing where clause comma. 2016-01-26 16:39:00 +11:00
Jeremy Wazny
d82d3b2cd1 Added where_trailing_comma option.
The default is 'false', since a lot of the time there's only a single
predicate.
2016-01-26 12:42:11 +11:00
Nick Cameron
3b24f6f7c4 Merge pull request #781 from kyeah/itemmac
Format item macros
2016-01-26 06:54:52 +13:00
Nick Cameron
6a077bee00 Merge pull request #782 from markstory/readme-checkstyle
Update the README concerning write modes.
2016-01-26 06:53:47 +13:00
Kevin Yeh
7fc70a1753 Add item macro tests 2016-01-24 13:11:18 -06:00
Mark Story
2ffb5fde9d Updates to readme based on feedback. 2016-01-23 11:33:50 -05:00
Mark Story
561323e4cd Update the README concerning write modes.
Add checkstyle and more detail on each of the write modes.
2016-01-22 22:33:59 -05:00
Kevin Yeh
f01ed6f507 Format item macros 2016-01-22 13:43:18 -06:00
Nick Cameron
81516fe8ca Merge pull request #745 from markstory/checkstyle-output
RFC implementation of checkstyle output
2016-01-22 17:48:39 +13:00
Mark Story
e9e5621307 Extract helper functions for testing.
These functions help reduce duplication in the test harness and make it
easier to add tests for other write-modes in the future.
2016-01-21 22:28:17 -05:00
Mark Story
9c275833fc Get checkstyle tests passing.
Fix up the checkstyle test so they pass. There is still an issue with
the content, but I think that is caused by a problem with how diffs are
being calculated presently.
2016-01-20 00:07:01 -05:00
Mark Story
d8c6f5954a Update checkstyle write mode to take Write arguments.
By accepting Write traits we can write tests using StringBuffer.
2016-01-19 00:23:38 -05:00
Mark Story
66d4faf53f Start tests for checkstyle.
They don't yet pass, I've clearly misunderstood the existing tests.
2016-01-18 22:44:10 -05:00
Mark Story
5632831bd1 Clean up function names for checkstyle output. 2016-01-14 22:04:24 -05:00
Marcus Klaas de Vries
6c63ed08ce Merge pull request #774 from rust-lang-nursery/issue698
Fix an off-by-one error due to the comma in a struct lit field
2016-01-14 19:08:46 +01:00
Nick Cameron
f0ca7aec24 Fix an off-by-one error due to the comma in a struct lit field
Also allows splitting the field expression on a new line after the field name.

Fixes #698
2016-01-14 20:26:15 +13:00
Nick Cameron
a37309ca0d Remove reference to 1.4 from README
closes #771
2016-01-14 18:39:44 +13:00
Nick Cameron
c024008bd1 tweak README.md 2016-01-14 17:58:23 +13:00
Mark Story
add80569ff Use PartialEq/Eq implementation instead of match.
Also cleanup from rebasing onto master.
2016-01-13 21:07:38 -05:00
Mark Story
58410ddd93 Extract checkstyle output into a separate module.
Rename functions a bit now that they are specific to checkstyle output.
2016-01-13 21:03:25 -05:00
Mark Story
3c968e1e38 Update based on pull request feedback.
* Extract duplicated logic.
* Make checkstyle errors into warnings.
2016-01-13 21:02:50 -05:00
Mark Story
de10545906 Encode XML entities. 2016-01-13 21:02:50 -05:00
Mark Story
c3632befb5 Remove unused argument. 2016-01-13 21:02:05 -05:00
Mark Story
309f284dfb Fix formatting errors. 2016-01-13 21:01:27 -05:00
Mark Story
d188854e13 Hack together checkstyle output that compiles.
I'm not sure it does something useful yet though.
2016-01-13 21:01:26 -05:00
Mark Story
0c9f27fe5e Start hacking checkstyle output in.
checkstyle now shows up on the option parser, and the code still
compiles/passes tests. Next up will be outputing the XML to stdout.
2016-01-13 20:59:18 -05:00
Marcus Klaas de Vries
3f7741bb0c Merge pull request #769 from svmnotn/write-mode-config
Allow for setting of write-mode via config file. FIxes #215
2016-01-13 18:11:11 +01:00
Victor M. Suarez
4f8938c616 Allow for setting of write-mode via config file. FIxes #215
Also from @marcusklaas:
 Refactor code output functions

 Specifically, `write_all_files` no longer returns a HashMap. It would sometimes
 contain items, and sometimes be empty. When "fixed" newlines are required, this
 must now be done with a separate call. The tests use this strategy and should now pass!
2016-01-12 18:12:48 -05:00
Marcus Klaas de Vries
ba465e0fc2 Merge pull request #766 from ConnorGBrewster/fix-#489
Added option for tighter punctuation in types. fixes #489
2016-01-12 22:52:34 +01:00
Marcus Klaas de Vries
4cefecb495 Merge pull request #768 from DarkDrek/amend-to-fix-#447
fixes parsing issue #767
2016-01-12 21:53:19 +01:00
Connor Brewster
7f8b9bd356 Added test case 2016-01-12 13:51:32 -07:00
Connor Brewster
479b69266b Changed TypeDensity::WhiteSpace to TypeDensity::Wide
Changed eq_str and plus_str assignments to use a match
2016-01-12 13:42:53 -07:00
Marcus Klaas de Vries
b99e8eda29 Merge pull request #757 from ConnorGBrewster/fix-#650
Fix for #650
2016-01-12 21:17:45 +01:00
DarkDrek
937e26d4e1 fixes parsing issue #767 2016-01-12 21:13:59 +01:00
Connor Brewster
d7a3256d40 If where is on the same line as the impl, { is put on the same line fixes #650
factored if clause into a separate function
2016-01-11 21:26:45 -07:00
Nick Cameron
36b82f3b00 Merge pull request #765 from DarkDrek/fix-#447-2
Fix #447 2. try
2016-01-12 15:41:16 +13:00
DarkDrek
20ccc7bf8e Removed the failing test part since it will work when #754 is accepted 2016-01-12 03:09:19 +01:00
DarkDrek
4da91e7df2 Handle more possible comment position for if else
Extended the test with the new possiblecomment positions
2016-01-12 03:08:48 +01:00
DarkDrek
b0eb0f5daa Keep comments between if and else blocks. Fixes #447 2016-01-12 03:08:16 +01:00
Nick Cameron
bdcc815b18 Merge pull request #762 from ConnorGBrewster/fix-#760
Where clause is on same line as fn if fn is empty Fixes #760
2016-01-12 14:49:59 +13:00
Connor Brewster
749697d845 Changed is_block_empty to has_body 2016-01-11 14:47:56 -07:00
Connor Brewster
dba2d8afd5 Added option for tighter punctuation in types. fixes #489 2016-01-11 12:26:57 -07:00
Connor Brewster
6b741a7194 Where clause is on same line as fn if fn is empty fix-#760
only applies if fn_empty_single_line is set to true
2016-01-10 22:06:06 -07:00
cassiersg
b236819f72 Merge pull request #756 from cassiersg/missed-comments
Detect (and recover) when comments disappear
2016-01-11 01:16:52 +01:00
Nick Cameron
0badc128f7 Merge pull request #740 from svmnotn/less_tmp_files
stop creating bk files if there are no changes. Fixes #733
2016-01-11 10:45:51 +13:00
Victor M. Suarez
56a3aac2b5 stop creating bk files if there are no changes. Fixes #733 2016-01-10 16:37:13 -05:00
Nick Cameron
cb085fc9ad Merge pull request #758 from cassiersg/issue-717
Fix issue with windows line endings (#717).
2016-01-11 10:24:14 +13:00
Gaëtan Cassiers
b117d7b2b8 Document comment::*CodeCharKind 2016-01-10 22:04:30 +01:00
Gaëtan Cassiers
598fcdddc3 Fix issue with windows line endings (#717).
The '\r' character wasn't counted in the line length.
2016-01-10 16:25:31 +01:00
Gaëtan Cassiers
9f98f725cb Detect when comments disappear
When the reformatted code doesn't contain the same quantity of comments
as the original code, use the original code instead of the reformatted
code.
This is done for all expressions and `let` statements.

This should be used at the finest grained level possible, to avoid that
a small disappearing comment prevents a big chunk of code to be
reformatted.

Kind of fixes (avoid disappearing comments, but prevents a good
formatting is such case) #285 #225 #563 #743
2016-01-10 15:20:58 +01:00