<commit_before>#!/bin/bash

set -e

DARTIUM_DIST=dartium-linux-x64-release.zip

echo -------------------
echo Fetching dartium
echo -------------------

curl http://storage.googleapis.com/dart-archive/channels/stable/raw/latest/dartium/$DARTIUM_DIST > $DARTIUM_DIST


unzip $DARTIUM_DIST > /dev/null
rm $DARTIUM_DIST
mv dartium-* dartium;

export DART_SDK="$PWD/dart-sdk"
export PATH="$DART_SDK/bin:$PATH"
export DARTIUM_BIN="$PWD/dartium/chrome"

echo -------------------
echo Dart analyzer
echo -------------------
which dart
which dartanalyzer
dartanalyzer lib/guinnessb_html.dart | grep "No issues found"

if [ $? -ne 0 ]; then
  echo Dart analyzer failed
  dartanalyzer lib/guinnessb_html.dart
  exit 1
fi


echo -------------------
echo "Pub run test"
echo -------------------
sh -e /etc/init.d/xvfb start
pub run test -p dartium

echo -------------------
echo "Pub run test examples"
echo -------------------
pub run test example/example.dart -p dartium
<commit_msg>Output dart analyzer output<commit_after>#!/bin/bash

set -e

DARTIUM_DIST=dartium-linux-x64-release.zip

echo -------------------
echo Fetching dartium
echo -------------------

curl http://storage.googleapis.com/dart-archive/channels/stable/raw/latest/dartium/$DARTIUM_DIST > $DARTIUM_DIST


unzip $DARTIUM_DIST > /dev/null
rm $DARTIUM_DIST
mv dartium-* dartium;

export DART_SDK="$PWD/dart-sdk"
export PATH="$DART_SDK/bin:$PATH"
export DARTIUM_BIN="$PWD/dartium/chrome"

echo -------------------
echo Dart analyzer
echo -------------------
which dart
which dartanalyzer
dartanalyzer lib/guinnessb_html.dart

if [ $? -ne 0 ]; then
  echo Dart analyzer failed
  dartanalyzer lib/guinnessb_html.dart
  exit 1
fi


echo -------------------
echo "Pub run test"
echo -------------------
sh -e /etc/init.d/xvfb start
pub run test -p dartium

echo -------------------
echo "Pub run test examples"
echo -------------------
pub run test example/example.dart -p dartium

{'fraction_non_alphanumeric': 0.24031007751937986, 'fraction_numerical': 0.004134366925064599, 'mean_word_length': 2.1582381729200653, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '746074', 'n_tokens_mistral': 708, 'n_tokens_neox': 644, 'n_words': 163}