Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1293)

Side by Side Diff: pkg/analyzer/test/services/data/style_guide_tests.data

Issue 474363002: Tweak for formatting constructor initializers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/services/formatter_impl.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 >>> DO use ; instead of {} for empty constructor bodies 1 >>> DO use ; instead of {} for empty constructor bodies
2 class Point { 2 class Point {
3 int x, y; 3 int x, y;
4 Point(this.x, this.y) {} 4 Point(this.x, this.y) {}
5 } 5 }
6 <<< 6 <<<
7 class Point { 7 class Point {
8 int x, y; 8 int x, y;
9 Point(this.x, this.y); 9 Point(this.x, this.y);
10 } 10 }
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 thirdField = "last"; 175 thirdField = "last";
176 } 176 }
177 <<< 177 <<<
178 class MyClass { 178 class MyClass {
179 var firstField, secondField, thirdField; 179 var firstField, secondField, thirdField;
180 MyClass() 180 MyClass()
181 : firstField = "some value", 181 : firstField = "some value",
182 secondField = "another", 182 secondField = "another",
183 thirdField = "last"; 183 thirdField = "last";
184 } 184 }
185 >>> DO format constructor initialization lists with each field on its own line.
186 class MyClass {
187 MyClass(looooooooooooooonA, looooooooooooooonB) : super(looooooooooooooonA, lo oooooooooooooonB);
188 MyClass(looooooooooooooonA, looooooooooooooonB) : this(looooooooooooooonA, loo ooooooooooooonB);
189 }
190 <<<
191 class MyClass {
192 MyClass(looooooooooooooonA, looooooooooooooonB)
193 : super(looooooooooooooonA, looooooooooooooonB);
194 MyClass(looooooooooooooonA, looooooooooooooonB)
195 : this(looooooooooooooonA, looooooooooooooonB);
196 }
185 >>> DO use a space after : in named parameters and named arguments. 197 >>> DO use a space after : in named parameters and named arguments.
186 class ListBox { 198 class ListBox {
187 bool showScrollbars; 199 bool showScrollbars;
188 200
189 ListBox({this.showScrollbars: false}); 201 ListBox({this.showScrollbars: false});
190 } 202 }
191 203
192 main() { 204 main() {
193 new ListBox(showScrollbars:true); 205 new ListBox(showScrollbars:true);
194 new ListBox(showScrollbars : true); 206 new ListBox(showScrollbars : true);
(...skipping 22 matching lines...) Expand all
217 } 229 }
218 } 230 }
219 >>> DO use four spaces for method cascades 231 >>> DO use four spaces for method cascades
220 var list = new List() 232 var list = new List()
221 ..addAll([1, 2, 3]) 233 ..addAll([1, 2, 3])
222 ..addAll([4, 5, 6]); 234 ..addAll([4, 5, 6]);
223 <<< 235 <<<
224 var list = new List() 236 var list = new List()
225 ..addAll([1, 2, 3]) 237 ..addAll([1, 2, 3])
226 ..addAll([4, 5, 6]); 238 ..addAll([4, 5, 6]);
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/services/formatter_impl.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698