forked from scalameta/scalafmt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChangelog01.scalatex
160 lines (148 loc) · 5 KB
/
Changelog01.scalatex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
@import Main._
@import org.scalafmt.readme.Readme._
@import org.scalafmt.config.ScalafmtConfig
@sect{0.1.6}
@ul
@li
scalafmt will not hang anymore, not even for
@lnk("deeply nested computer generated code", "https://github.com/scalameta/scalafmt/blob/124134dcd6a6c45d398d713ade266e071f4dc73c/core/src/test/scala/org/scalafmt/pathologicalcasestest.scala#l13").
when scalafmt detects it's struggling to format a statement,
it falls back to heuristics that return decent, but suboptimal, formatting
output. if the heuristics still fail, scalafmt falls back to the
original formatting of the code up until the next statement.
@li
spark, akka and the intellij scala plugin have been added to the
test suite, which now runs on a total of 9.398 files from external
projects. that's almost 8.000 more files than in 0.1.5! some key
statistics from formatting all 9.398 files:
@table
@thead
@tr
@th
computer
@th
75th percentile
@th
average
@th
max
@tbody
@tr
@td
2.5 ghz i7 macbook pro
@td
119ms
@td
112ms
@td
7.1s
@tr
@td
travis ci (for fun)
@td
3.7s
@td
2.8s
@td
45.2s
@p
there is still a lot of work to do. the plan is to investigate
the 90+ percentile cases in future releases as well as run
more jmh benchmarks.
@li
for loops can now have multiple if guards in a row. for example:
@example
object forloopguards {
for {
x <- list(1, 2, 3)
if (x != 1)
if (x != 3)
} yield x
}
@li
fixed bugs where a newline would come after return keyword.
@li
fixed bugs where scalafmt would crash on the following if it exceeded
the column limit.
@hl.scala
new foo with bar with kaz {}
@li
scalafmt no longer crashes when xml literal are used in infix
applications.
@li
minor changes to select statement formatting.
@sect{0.1.5}
@ul
@li
select chains are kept on a single line if they fit up to the last
opening curly brace.
@hl.scala
// column |
// before
List(1)
.map { x =>
x + 1
}
// after
List(1).map { x =>
x + 1
}
@li
Really long sequences of infix applications (for example, string
concatenations) don't hog anymore.
@li
Various small bug and speed improvements.
For example, all files in
@lnk("Fastparse", "https://github.com/lihaoyi/fastparse/"),
@lnk("Scalding", "https://github.com/twitter/scalding") and
@lnk("Goose", "https://github.com/GravityLabs/goose") that had
problems with 0.1.4 format without issues on 0.1.5.
@li
Ramped up testing.
Fastparse, Scalding and Goose
have been added to the test suite, which now runs on 1405 files
from external projects.
The plan is to reach around 28.000 files in the coming 0.1.x releases,
by including projects like
@lnk("spark", "https://github.com/scalameta/scalafmt/issues/133"),
@lnk("akka", "https://github.com/scalameta/scalafmt/issues/134") and
@lnk("intellij-scala", "https://github.com/scalameta/scalafmt/issues/135").
@li
Made rather large internal refactorings, which shouldn't affect
you as a user.
@sect{0.1.4}
@ul
@li
@sect.ref{assumeStandardLibraryStripMargin}.
@li
@sect.ref{// format: off}.
@li
@lnk("Hanging behavior", "https://github.com/scalameta/scalafmt/issues/127").
@li
@lnk("Dozens of other small fixes", "https://github.com/scalameta/scalafmt/pull/128").
@sect{0.1.3}
@ul
@li
@lnk("Better handling of type parameters", "https://github.com/scalameta/scalafmt/issues/117").
Try it on your @lnk("craziest type signatures", "https://github.com/scalameta/scalafmt/blob/6c4e5165bcbfa3a932cc112d7e87a1e919fcaf99/core/src/test/resources/default/DefDef.stat#L63").
@li
@lnk("Array assignments are treated like regular call-site applications", "https://github.com/scalameta/scalafmt/issues/122").
@li
Commented out code remains un-indented (lines that start with
@code("//") stay at indentation 0).
@li
Blank lines are only forced before top-level definitions and methods
with docstrings.
@sect{0.1.2}
@ul
@li
Closed @lnk("17 formatting issues", "https://github.com/scalameta/scalafmt/issues?utf8=%E2%9C%93&q=author%3Asjrd+created%3A%3C2016-03-10").
Thank you Sebastian!
@li
Added Java 6+7 compatibility, was Java 8 before.
@sect{0.1.1}
@ul
@li
The @code("-f") flag in the CLI can be a directory.
@p
This page was last updated on @lastUpdated.