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

Unified Diff: pkg/analyzer_experimental/bin/formatter.dart

Issue 26229004: Code formatter transform for empty constructor bodys (a la Style guide). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/services/formatter_impl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_experimental/bin/formatter.dart
===================================================================
--- pkg/analyzer_experimental/bin/formatter.dart (revision 28369)
+++ pkg/analyzer_experimental/bin/formatter.dart (working copy)
@@ -19,11 +19,14 @@
final argParser = _initArgParser();
final defaultSelection = new Selection(-1, -1);
+var formatterSettings;
+
bool machineFormat;
bool overwriteFileContents;
Selection selection;
const followLinks = false;
+
main() {
var options = argParser.parse(new Options().arguments);
if (options['help']) {
@@ -44,6 +47,8 @@
machineFormat = options['machine'];
overwriteFileContents = options['write'];
selection = _parseSelection(options['selection']);
+ formatterSettings =
+ new FormatterOptions(codeTransforms: options['transform']);
}
Selection _parseSelection(selectionOption) {
@@ -150,8 +155,8 @@
}
/// Format the given [src] as a compilation unit.
-String _formatCU(src, {options: const FormatterOptions()}) {
- var formatResult = new CodeFormatter(options).format(
+String _formatCU(src) {
+ var formatResult = new CodeFormatter(formatterSettings).format(
CodeKind.COMPILATION_UNIT, src, selection: selection);
if (machineFormat) {
if (formatResult.selection == null) {
« no previous file with comments | « no previous file | pkg/analyzer_experimental/lib/src/services/formatter_impl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698