enable mono_repo self validate (#1353)

diff --git a/.travis.yml b/.travis.yml
index 1b720b4..d8c3288 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,8 +1,7 @@
-# Created with package:mono_repo v2.3.0
+# Created with package:mono_repo v2.5.0
 language: dart
 
 # Custom configuration
-sudo: required
 addons:
   chrome: stable
 env:
@@ -12,50 +11,55 @@
 
 jobs:
   include:
+    - stage: mono_repo_self_validate
+      name: mono_repo self validate
+      os: linux
+      script: tool/mono_repo_self_validate.sh
     - stage: analyze_and_format
       name: "SDK: dev; PKGS: pkgs/test, pkgs/test_api, pkgs/test_core; TASKS: [`dartfmt -n --set-exit-if-changed .`, `dartanalyzer --enable-experiment=non-nullable --fatal-infos --fatal-warnings .`]"
       dart: dev
       os: linux
       env: PKGS="pkgs/test pkgs/test_api pkgs/test_core"
-      script: ./tool/travis.sh dartfmt dartanalyzer
+      script: tool/travis.sh dartfmt dartanalyzer
     - stage: unit_test
       name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run --enable-experiment=non-nullable test --preset travis -x phantomjs -x node --total-shards 5 --shard-index 0`"
       dart: dev
       os: linux
       env: PKGS="pkgs/test"
-      script: ./tool/travis.sh command_0
+      script: tool/travis.sh command_0
     - stage: unit_test
       name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run --enable-experiment=non-nullable test --preset travis -x phantomjs -x node --total-shards 5 --shard-index 1`"
       dart: dev
       os: linux
       env: PKGS="pkgs/test"
-      script: ./tool/travis.sh command_1
+      script: tool/travis.sh command_1
     - stage: unit_test
       name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run --enable-experiment=non-nullable test --preset travis -x phantomjs -x node --total-shards 5 --shard-index 2`"
       dart: dev
       os: linux
       env: PKGS="pkgs/test"
-      script: ./tool/travis.sh command_2
+      script: tool/travis.sh command_2
     - stage: unit_test
       name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run --enable-experiment=non-nullable test --preset travis -x phantomjs -x node --total-shards 5 --shard-index 3`"
       dart: dev
       os: linux
       env: PKGS="pkgs/test"
-      script: ./tool/travis.sh command_3
+      script: tool/travis.sh command_3
     - stage: unit_test
       name: "SDK: dev; PKG: pkgs/test; TASKS: `xvfb-run -s \"-screen 0 1024x768x24\" pub run --enable-experiment=non-nullable test --preset travis -x phantomjs -x node --total-shards 5 --shard-index 4`"
       dart: dev
       os: linux
       env: PKGS="pkgs/test"
-      script: ./tool/travis.sh command_4
+      script: tool/travis.sh command_4
     - stage: unit_test
       name: "SDK: dev; PKG: pkgs/test_api; TASKS: `pub run --enable-experiment=non-nullable test --preset travis -x browser`"
       dart: dev
       os: linux
       env: PKGS="pkgs/test_api"
-      script: ./tool/travis.sh command_5
+      script: tool/travis.sh command_5
 
 stages:
+  - mono_repo_self_validate
   - analyze_and_format
   - unit_test
 
diff --git a/mono_repo.yaml b/mono_repo.yaml
index 77c90a3..266bfe4 100644
--- a/mono_repo.yaml
+++ b/mono_repo.yaml
@@ -1,6 +1,6 @@
 # See with https://github.com/dart-lang/mono_repo for details on this file
+self_validate: true
 travis:
-  sudo: required
   addons:
     chrome: stable
   env:
diff --git a/tool/mono_repo_self_validate.sh b/tool/mono_repo_self_validate.sh
new file mode 100755
index 0000000..ec70a28
--- /dev/null
+++ b/tool/mono_repo_self_validate.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+# Created with package:mono_repo v2.5.0
+
+# Support built in commands on windows out of the box.
+function pub {
+       if [[ $TRAVIS_OS_NAME == "windows" ]]; then
+        command pub.bat "$@"
+    else
+        command pub "$@"
+    fi
+}
+
+set -v -e
+pub global activate mono_repo 2.5.0
+pub global run mono_repo travis --validate
diff --git a/tool/travis.sh b/tool/travis.sh
index d8bf819..fb12320 100755
--- a/tool/travis.sh
+++ b/tool/travis.sh
@@ -1,27 +1,27 @@
 #!/bin/bash
-# Created with package:mono_repo v2.3.0
+# Created with package:mono_repo v2.5.0
 
 # Support built in commands on windows out of the box.
 function pub {
-       if [[ $TRAVIS_OS_NAME == "windows" ]]; then
-        command pub.bat "$@"
-    else
-        command pub "$@"
-    fi
+  if [[ $TRAVIS_OS_NAME == "windows" ]]; then
+    command pub.bat "$@"
+  else
+    command pub "$@"
+  fi
 }
 function dartfmt {
-       if [[ $TRAVIS_OS_NAME == "windows" ]]; then
-        command dartfmt.bat "$@"
-    else
-        command dartfmt "$@"
-    fi
+  if [[ $TRAVIS_OS_NAME == "windows" ]]; then
+    command dartfmt.bat "$@"
+  else
+    command dartfmt "$@"
+  fi
 }
 function dartanalyzer {
-       if [[ $TRAVIS_OS_NAME == "windows" ]]; then
-        command dartanalyzer.bat "$@"
-    else
-        command dartanalyzer "$@"
-    fi
+  if [[ $TRAVIS_OS_NAME == "windows" ]]; then
+    command dartanalyzer.bat "$@"
+  else
+    command dartanalyzer "$@"
+  fi
 }
 
 if [[ -z ${PKGS} ]]; then