syncbase: Add "make dartfmt" task.

The "make check-fmt" task is now "make dartfmt".  It formats whitespace
in dart files to conform to style conventions.

Change-Id: I613cae0073d724ce04c3266029c889ea03abfebc
diff --git a/Makefile b/Makefile
index de1b1eb..8b6c976 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 SHELL := /bin/bash -euo pipefail
 PWD := $(shell pwd)
 V23_GOPATH := $(shell echo `v23 run env | grep GOPATH | cut -d\= -f2`)
-DART_FILES := $(shell find $(PWD)/dart -name *.dart ! -name *.part.dart)
+DART_FILES := $(shell find dart/bin dart/lib dart/test -name "*.dart" -not -path "dart/lib/gen/*")
 GO_FILES := $(shell find go/src -name "*.go")
 V23_GO_FILES := $(shell find $(V23_ROOT) -name "*.go")
 
@@ -126,13 +126,12 @@
 gen/mojo/syncbase_server.mojo: $(GO_FILES) $(V23_GO_FILES) gen-mojom $(MOJO_SHARED_LIB)
 	$(call MOGO_BUILD,v.io/syncbase/x/ref/services/syncbase/syncbased,$@)
 
-# Checks that the dart-style is being met. Note: Comments are ignored when
-# checking whitespace.
-.PHONY: check-fmt
-check-fmt:
-	dartfmt -n $(DART_FILES)
+# Formats dart files to follow dart style conventions.
+.PHONY: dartfmt
+dartfmt:
+	dartfmt --overwrite --line-length 120 $(DART_FILES)
 
-# Lint src and test files with dartanalyzer. This takes a few seconds.
+# Lints src and test files with dartanalyzer. This takes a few seconds.
 .PHONY: dartanalyzer
 dartanalyzer: dart/packages gen-mojom
 	# TODO(nlacasse): Fix dart mojom binding generator so it does not produce
diff --git a/dart/lib/echo_client.dart b/dart/lib/echo_client.dart
index df38894..d1ccf05 100644
--- a/dart/lib/echo_client.dart
+++ b/dart/lib/echo_client.dart
@@ -10,9 +10,9 @@
 class EchoClient extends ClientBase {
   final mojom.EchoProxy _proxy;
 
-  EchoClient(MojoHandle handle, String url) :
-    _proxy = new mojom.EchoProxy.unbound(),
-    super(handle, url);
+  EchoClient(MojoHandle handle, String url)
+      : _proxy = new mojom.EchoProxy.unbound(),
+        super(handle, url);
 
   Future connect() {
     return connectWithProxy(_proxy);
diff --git a/dart/lib/src/client_base.dart b/dart/lib/src/client_base.dart
index 3c94c40..19a7121 100644
--- a/dart/lib/src/client_base.dart
+++ b/dart/lib/src/client_base.dart
@@ -14,8 +14,7 @@
   final _initializeCompleter = new Completer();
   Future get initialized => _initializeCompleter.future;
 
-  InitializedApplication.fromHandle(MojoHandle handle) :
-    super.fromHandle(handle);
+  InitializedApplication.fromHandle(MojoHandle handle) : super.fromHandle(handle);
 
   void initialize(List<String> args, String url) {
     _initializeCompleter.complete();
@@ -31,8 +30,7 @@
   final String url;
   final InitializedApplication _app;
 
-  ClientBase(MojoHandle handle, this.url) :
-    this._app = new InitializedApplication.fromHandle(handle);
+  ClientBase(MojoHandle handle, this.url) : this._app = new InitializedApplication.fromHandle(handle);
 
   Future connectWithProxy(ProxyBase p) async {
     await _app.initialized;
diff --git a/dart/lib/syncbase_client.dart b/dart/lib/syncbase_client.dart
index 94b2069..e8f288c 100644
--- a/dart/lib/syncbase_client.dart
+++ b/dart/lib/syncbase_client.dart
@@ -10,9 +10,9 @@
 class SyncbaseClient extends ClientBase {
   final mojom.SyncbaseProxy _proxy;
 
-  SyncbaseClient(MojoHandle handle, String url) :
-    _proxy = new mojom.SyncbaseProxy.unbound(),
-    super(handle, url);
+  SyncbaseClient(MojoHandle handle, String url)
+      : _proxy = new mojom.SyncbaseProxy.unbound(),
+        super(handle, url);
 
   Future connect() async {
     return connectWithProxy(_proxy);
diff --git a/dart/pubspec.yaml b/dart/pubspec.yaml
index fe4af35..cbdd228 100644
--- a/dart/pubspec.yaml
+++ b/dart/pubspec.yaml
@@ -1,4 +1,7 @@
-name: Ether
+name: ether
 dependencies:
     mojo: any
+dev_dependencies:
+    dart_style: any
     test: any
+
diff --git a/dart/test/echo_test.dart b/dart/test/echo_test.dart
index 56be100..daf51bc 100644
--- a/dart/test/echo_test.dart
+++ b/dart/test/echo_test.dart
@@ -1,5 +1,4 @@
 #!mojo mojo:dart_content_handler
-
 import 'dart:async';
 
 import 'package:mojo/core.dart' show MojoHandle;
diff --git a/dart/test/syncbase_test.dart b/dart/test/syncbase_test.dart
index 3958eac..8bcfba7 100755
--- a/dart/test/syncbase_test.dart
+++ b/dart/test/syncbase_test.dart
@@ -1,5 +1,4 @@
 #!mojo mojo:dart_content_handler
-
 import 'package:mojo/core.dart' show MojoHandle;
 import 'package:test/test.dart';