<commit_before>#!/bin/bash

# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if [ "$#" == "0" ]; then
  echo -e '\033[31mAt least one task argument must be provided!\033[0m'
  echo -e 'Valid tasks: dartfmt dartanalyzer vm_test dart2js_test dartdevc_test'
  exit 1
fi

EXIT_CODE=0

while (( "$#" )); do
  TASK=$1
  case $TASK in
  dartfmt) echo
    echo -e '\033[1mTASK: dartfmt\033[22m'
    echo -e 'dartfmt -n --set-exit-if-changed .'
    dartfmt -n --set-exit-if-changed . || EXIT_CODE=$?
    ;;
  dartanalyzer) echo
    echo -e '\033[1mTASK: dartanalyzer\033[22m'
    echo -e 'dartanalyzer --fatal-warnings .'
    dartanalyzer --lints --fatal-warnings --fatal-infos . || EXIT_CODE=$?
    ;;
  vm_test) echo
    echo -e '\033[1mTASK: vm_test\033[22m'
    echo -e 'pub run test -p vm'
    pub run test -p vm -r expanded || EXIT_CODE=$?
    ;;
  dart2js_test) echo
    echo -e '\033[1mTASK: dart2js_test\033[22m'
    echo -e 'pub run test -p chrome -x fails-on-dart2js'
    pub run test -p chrome -x fails-on-dart2js -r expanded || EXIT_CODE=$?
    ;;
  dartdevc_test) echo
    echo -e '\033[1mTASK: dartdevc_test\033[22m'
    echo -e '*** TEMPORARILY DISABLED ON null_safety branch pending migration on build_* packages'
    # TODO(cbracken): Re-enable when build_packages have NNBD releases.
    # https://github.com/google/quiver-dart/issues/619
    #./tool/travis/ddc_test.sh -p chrome -x fails-on-dartdevc -r expanded || EXIT_CODE=$?
    ;;
  *) echo -e "\033[31mUnknown task: '${TASK}'. Error!\033[0m"
    EXIT_CODE=1
    ;;<commit_msg>Disable dartfmt checks during NNBD migration (#635)<commit_after>#!/bin/bash

# Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

if [ "$#" == "0" ]; then
  echo -e '\033[31mAt least one task argument must be provided!\033[0m'
  echo -e 'Valid tasks: dartfmt dartanalyzer vm_test dart2js_test dartdevc_test'
  exit 1
fi

EXIT_CODE=0

while (( "$#" )); do
  TASK=$1
  case $TASK in
  dartfmt) echo
    echo -e '\033[1mTASK: dartfmt\033[22m'
    echo -e 'dartfmt -n --set-exit-if-changed .'
    # TODO(cbracken): Re-enable when build_packages have NNBD releases.
    # https://github.com/google/quiver-dart/issues/634
    #dartfmt -n --set-exit-if-changed . || EXIT_CODE=$?
    ;;
  dartanalyzer) echo
    echo -e '\033[1mTASK: dartanalyzer\033[22m'
    echo -e 'dartanalyzer --fatal-warnings .'
    dartanalyzer --lints --fatal-warnings --fatal-infos . || EXIT_CODE=$?
    ;;
  vm_test) echo
    echo -e '\033[1mTASK: vm_test\033[22m'
    echo -e 'pub run test -p vm'
    pub run test -p vm -r expanded || EXIT_CODE=$?
    ;;
  dart2js_test) echo
    echo -e '\033[1mTASK: dart2js_test\033[22m'
    echo -e 'pub run test -p chrome -x fails-on-dart2js'
    pub run test -p chrome -x fails-on-dart2js -r expanded || EXIT_CODE=$?
    ;;
  dartdevc_test) echo
    echo -e '\033[1mTASK: dartdevc_test\033[22m'
    echo -e '*** TEMPORARILY DISABLED ON null_safety branch pending migration on build_* packages'
    # TODO(cbracken): Re-enable when build_packages have NNBD releases.
    # https://github.com/google/quiver-dart/issues/619
    #./tool/travis/ddc_test.sh -p chrome -x fails-on-dartdevc -r expanded || EXIT_CODE=$?
    ;;
  *) echo -e "\033[31mUnknown task: '${TASK}'. Error!\033[0m"
    EXIT_CODE=1
    ;;
{'fraction_non_alphanumeric': 0.12747353888633225, 'fraction_numerical': 0.04003681546249425, 'mean_word_length': 3.1838306063522617, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2088093', 'n_tokens_mistral': 1684, 'n_tokens_neox': 1539, 'n_words': 484}