<commit_before>package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"

	"github.com/haklop/bazooka/commons/matrix"

	bazooka "github.com/haklop/bazooka/commons"
)

const (
	SourceFolder      = "/bazooka"
	OutputFolder      = "/bazooka-output"
	MetaFolder        = "/meta"
	BazookaConfigFile = ".bazooka.yml"
	TravisConfigFile  = ".travis.yml"
	Golang            = "go"
)

func main() {
	file, err := bazooka.ResolveConfigFile(SourceFolder)
	if err != nil {
		log.Fatal(err)
	}

	conf := &ConfigGolang{}
	err = bazooka.Parse(file, conf)
	if err != nil {
		log.Fatal(err)
	}

	mx := matrix.Matrix{
		Golang: conf.GoVersions,
	}

	if len(conf.GoVersions) == 0 {
		mx[Golang] = []string{"tip"}
	}
	mx.IterAll(func(permutation map[string]string, counter string) {
		if err := manageGoVersion(counter, conf, permutation[Golang]); err != nil {
			log.Fatal(err)
		}
	}, nil)
}

func manageGoVersion(counter string, conf *ConfigGolang, version string) error {
	conf.GoVersions = []string{}
	setGodir(conf)
	setDefaultInstall(conf)
	err := setDefaultScript(conf)
	if err != nil {
		return err
	}
	image, err := resolveGoImage(version)
	conf.FromImage = image
	if err != nil {
		return err
	}

	err = bazooka.AppendToFile(fmt.Sprintf("%s/%s", MetaFolder, counter), fmt.Sprintf("%s: %s\n", Golang, version), 0644)
	if err != nil {
		return err
	}
	return bazooka.Flush(conf, fmt.Sprintf("%s/.bazooka.%s.yml", OutputFolder, counter))
}

func setGodir(conf *ConfigGolang) {
	fmt.Println("Conf: %#v", conf)<commit_msg>Remove useless log<commit_after>package main

import (
	"bufio"
	"fmt"
	"io"
	"log"
	"os"

	"github.com/haklop/bazooka/commons/matrix"

	bazooka "github.com/haklop/bazooka/commons"
)

const (
	SourceFolder      = "/bazooka"
	OutputFolder      = "/bazooka-output"
	MetaFolder        = "/meta"
	BazookaConfigFile = ".bazooka.yml"
	TravisConfigFile  = ".travis.yml"
	Golang            = "go"
)

func main() {
	file, err := bazooka.ResolveConfigFile(SourceFolder)
	if err != nil {
		log.Fatal(err)
	}

	conf := &ConfigGolang{}
	err = bazooka.Parse(file, conf)
	if err != nil {
		log.Fatal(err)
	}

	mx := matrix.Matrix{
		Golang: conf.GoVersions,
	}

	if len(conf.GoVersions) == 0 {
		mx[Golang] = []string{"tip"}
	}
	mx.IterAll(func(permutation map[string]string, counter string) {
		if err := manageGoVersion(counter, conf, permutation[Golang]); err != nil {
			log.Fatal(err)
		}
	}, nil)
}

func manageGoVersion(counter string, conf *ConfigGolang, version string) error {
	conf.GoVersions = []string{}
	setGodir(conf)
	setDefaultInstall(conf)
	err := setDefaultScript(conf)
	if err != nil {
		return err
	}
	image, err := resolveGoImage(version)
	conf.FromImage = image
	if err != nil {
		return err
	}

	err = bazooka.AppendToFile(fmt.Sprintf("%s/%s", MetaFolder, counter), fmt.Sprintf("%s: %s\n", Golang, version), 0644)
	if err != nil {
		return err
	}
	return bazooka.Flush(conf, fmt.Sprintf("%s/.bazooka.%s.yml", OutputFolder, counter))
}

func setGodir(conf *ConfigGolang) {
{'fraction_non_alphanumeric': 0.15634415801807833, 'fraction_numerical': 0.0033478406427854034, 'mean_word_length': 3.8506493506493507, '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': '5970306', 'n_tokens_mistral': 1250, 'n_tokens_neox': 1176, 'n_words': 234}