<commit_before>#!/bin/sh

# Generate go dependencies, for make. Uses `go list".
# Usage: makedepend.sh [-t] output package path [extra]

PATH_FORMAT='{{join .Deps "\n"}}'
FILE_FORMAT='{{ range $file := .GoFiles }} {{$.Dir}}/{{$file}}{{"\n"}}{{end}}'

if [ "$1" = "-t" ]
then
  PATH_FORMAT='{{ if .TestGoFiles }} {{.ImportPath}} {{end}}'
  shift
fi

out=$1
pkg=$2
path=$3
extra=$4

# check for mandatory parameters
test -n "$out$pkg$path" || exit 1

echo "$out: $extra\\"
go list -f "$PATH_FORMAT" $path |
  grep "$pkg" |
  xargs go list -f "$FILE_FORMAT" |
  sed -e "s|^ ${GOPATH}| \$(GOPATH)|;s/$/ \\\\/"
echo " #"<commit_msg>Make sure to add the current module to the list<commit_after>#!/bin/sh

# Generate go dependencies, for make. Uses `go list".
# Usage: makedepend.sh [-t] output package path [extra]

PATH_FORMAT='{{ .ImportPath }}{{"\n"}}{{join .Deps "\n"}}'
FILE_FORMAT='{{ range $file := .GoFiles }} {{$.Dir}}/{{$file}}{{"\n"}}{{end}}'

if [ "$1" = "-t" ]
then
  PATH_FORMAT='{{ if .TestGoFiles }} {{.ImportPath}} {{end}}'
  shift
fi

out=$1
pkg=$2
path=$3
extra=$4

# check for mandatory parameters
test -n "$out$pkg$path" || exit 1

echo "$out: $extra\\"
go list -f "$PATH_FORMAT" $path |
  grep "$pkg" |
  xargs go list -f "$FILE_FORMAT" |
  sed -e "s|^ ${GOPATH}| \$(GOPATH)|;s/$/ \\\\/"
echo " #"
{'fraction_non_alphanumeric': 0.24828636709824828, 'fraction_numerical': 0.00913937547600914, 'mean_word_length': 3.8308823529411766, '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': '2073975', 'n_tokens_mistral': 533, 'n_tokens_neox': 510, 'n_words': 149}