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

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

Issue 151243003: Fixes for empty class and method bodies. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 10 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
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 <<< 157 <<<
158 spaces() { 158 spaces() {
159 var numbers = <int>[1, 2, (3 + 4)]; 159 var numbers = <int>[1, 2, (3 + 4)];
160 } 160 }
161 >>> DO use a space before { in function and method bodies. 161 >>> DO use a space before { in function and method bodies.
162 getEmptyFn(a){ 162 getEmptyFn(a){
163 return (){}; 163 return (){};
164 } 164 }
165 <<< 165 <<<
166 getEmptyFn(a) { 166 getEmptyFn(a) {
167 return () { 167 return () {};
168 };
169 } 168 }
170 >>> DO format constructor initialization lists with each field on its own line. 169 >>> DO format constructor initialization lists with each field on its own line.
171 class MyClass { 170 class MyClass {
172 var firstField, secondField, thirdField; 171 var firstField, secondField, thirdField;
173 MyClass() : firstField = "some value", secondField = "another", 172 MyClass() : firstField = "some value", secondField = "another",
174 thirdField = "last"; 173 thirdField = "last";
175 } 174 }
176 <<< 175 <<<
177 class MyClass { 176 class MyClass {
178 var firstField, secondField, thirdField; 177 var firstField, secondField, thirdField;
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 215 }
217 } 216 }
218 >>> DO use four spaces for method cascades 217 >>> DO use four spaces for method cascades
219 var list = new List() 218 var list = new List()
220 ..addAll([1, 2, 3]) 219 ..addAll([1, 2, 3])
221 ..addAll([4, 5, 6]); 220 ..addAll([4, 5, 6]);
222 <<< 221 <<<
223 var list = new List() 222 var list = new List()
224 ..addAll([1, 2, 3]) 223 ..addAll([1, 2, 3])
225 ..addAll([4, 5, 6]); 224 ..addAll([4, 5, 6]);
OLDNEW
« no previous file with comments | « pkg/analyzer/test/services/data/stmt_tests.data ('k') | pkg/analyzer/test/services/formatter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698