<commit_before>#!/bin/bash -e
cd $(dirname $0)
PATH=$HOME/go/bin:$PATH
unset GOPATH
export GO111MODULE=on

function v
{
  echo
  echo $@
  $@
}

if ! type -p goveralls; then
  v go get github.com/mattn/goveralls
fi

if ! type -p shadow; then
  v go get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
fi

if ! type -p goreturns; then
  v go get github.com/sqs/goreturns
fi

echo date...
v go test -v -covermode=count -coverprofile=date.out .
v go tool cover -func=date.out
[ -z "$COVERALLS_TOKEN" ] || goveralls -coverprofile=date.out -service=travis-ci -repotoken $COVERALLS_TOKEN

for d in clock period timespan view; do
  echo $d...
  v go test -v -covermode=count -coverprofile=$d.out ./$d
  v go tool cover -func=$d.out
  [ -z "$COVERALLS_TOKEN" ] || goveralls -coverprofile=$d.out -service=travis-ci -repotoken $COVERALLS_TOKEN
done

v goreturns -l -w *.go */*.go
v go vet ./...
v go vet -vettool=$(type -p shadow) ./...<commit_msg>withdrawn shadowing checks<commit_after>#!/bin/bash -e
cd $(dirname $0)
PATH=$HOME/go/bin:$PATH
unset GOPATH
export GO111MODULE=on

function v
{
  echo
  echo $@
  $@
}

if ! type -p goveralls; then
  v go get github.com/mattn/goveralls
fi

#if ! type -p shadow; then
#  v go get golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
#fi

if ! type -p goreturns; then
  v go get github.com/sqs/goreturns
fi

echo date...
v go test -v -covermode=count -coverprofile=date.out .
v go tool cover -func=date.out
[ -z "$COVERALLS_TOKEN" ] || goveralls -coverprofile=date.out -service=travis-ci -repotoken $COVERALLS_TOKEN

for d in clock period timespan view; do
  echo $d...
  v go test -v -covermode=count -coverprofile=$d.out ./$d
  v go tool cover -func=$d.out
  [ -z "$COVERALLS_TOKEN" ] || goveralls -coverprofile=$d.out -service=travis-ci -repotoken $COVERALLS_TOKEN
done

v goreturns -l -w *.go */*.go

v go vet ./...

# shadow check fails in Travis
#v go vet -vettool=$(type -p shadow) ./...

{'fraction_non_alphanumeric': 0.14462171899125065, 'fraction_numerical': 0.004117344312918168, 'mean_word_length': 3.226086956521739, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1144028', 'n_tokens_mistral': 781, 'n_tokens_neox': 764, 'n_words': 225}