<commit_before>package main

// go generate script for generating mocks for all interfaces
// Uses mockery (https://github.com/vektra/mockery) to generate the actual mocks.
// Install mockery using 'go get github.com/vektra/mockery/.../'

import (
	"fmt"
	"os"
	"os/exec"
	"strings"
	"sync"
)

func main() {
	directories, err := glideNoVendor()
	if err != nil {
		os.Stderr.WriteString(fmt.Sprintf("Could not run 'glide nv': %s\n", err))
		os.Exit(1)
	}

	var wg sync.WaitGroup
	wg.Add(len(directories))
	for _, d := range directories {
		dir := d
		go func() {
			defer wg.Done()
			fmt.Printf("Generating mocks for '%s'...\n", dir)
			err = generateMocks(dir)
			if err != nil {
				os.Stderr.WriteString(fmt.Sprintf("Could not generate mocks for directory '%s': %s\n", dir, err))
				os.Exit(2)
			}
		}()
	}
	wg.Wait()
}

func glideNoVendor() ([]string, error) {
	cmd := exec.Command("glide", "nv")
	bytes, err := cmd.Output()
	if err != nil {
		return nil, err
	}

	lines := strings.Split(string(bytes), "\n")
	filtered := make([]string, 0, len(lines))
	for _, l := range lines {
		line := strings.TrimSuffix(l, "...")
		if line != "" && line != "." && line != "./mocks/" {
			filtered = append(filtered, line)
		}
	}
	return filtered, err
}

func generateMocks(dir string) error {
	args := []string{"-dir", dir, "-recursive", "-all", "-inpkg"}
	cmd := exec.Command("mockery", args...)
	return cmd.Run()
}<commit_msg>Be verbose during generating mocks<commit_after>package main

// go generate script for generating mocks for all interfaces
// Uses mockery (https://github.com/vektra/mockery) to generate the actual mocks.
// Install mockery using 'go get github.com/vektra/mockery/.../'

import (
	"fmt"
	"os"
	"os/exec"
	"strings"
	"sync"
)

func main() {
	directories, err := glideNoVendor()
	if err != nil {
		os.Stderr.WriteString(fmt.Sprintf("Could not run 'glide nv': %s\n", err))
		os.Exit(1)
	}

	var wg sync.WaitGroup
	wg.Add(len(directories))
	for _, d := range directories {
		dir := d
		go func() {
			defer wg.Done()
			fmt.Printf("Generating mocks for '%s'...\n", dir)
			err = generateMocks(dir)
			if err != nil {
				os.Stderr.WriteString(fmt.Sprintf("Could not generate mocks for directory '%s': %s\n", dir, err))
				os.Exit(2)
			}
		}()
	}
	wg.Wait()
}

func glideNoVendor() ([]string, error) {
	cmd := exec.Command("glide", "nv")
	bytes, err := cmd.Output()
	if err != nil {
		return nil, err
	}

	lines := strings.Split(string(bytes), "\n")
	filtered := make([]string, 0, len(lines))
	for _, l := range lines {
		line := strings.TrimSuffix(l, "...")
		if line != "" && line != "." && line != "./mocks/" {
			filtered = append(filtered, line)
		}
	}
	return filtered, err
}

func generateMocks(dir string) error {
	args := []string{"-dir", dir, "-recursive", "-all", "-inpkg"}
	cmd := exec.Command("mockery", args...)
	buf, err := cmd.CombinedOutput()
	fmt.Println(string(buf))
	return err
}
{'fraction_non_alphanumeric': 0.1884206920178143, 'fraction_numerical': 0.0020554984583761563, 'mean_word_length': 3.4042232277526394, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '2619080', 'n_tokens_mistral': 1155, 'n_tokens_neox': 1070, 'n_words': 284}