<commit_before>package main

import "os"

type ADFSConfig struct {
	Username string
	Password string
	Hostname string
}

func newADFSConfig() *ADFSConfig {
	authVars := &ADFSConfig{
		Username: os.Getenv("AD_USER"),
		Password: os.Getenv("AD_PASS"),
		Hostname: os.Getenv("AD_HOST"),
	}

	return authVars
}<commit_msg>Add support for a configuration file<commit_after>package main

import (
	"fmt"
	"os"

	"gopkg.in/ini.v1"
)

type ADFSConfig struct {
	Username string `ini:"user"`
	Password string `ini:"pass"`
	Hostname string `ini:"host"`
}

func newADFSConfig() *ADFSConfig {

	configPath := fmt.Sprintf("%s/.config/auth-aws/config.ini", os.Getenv("HOME"))
	adfsConfig := new(ADFSConfig)

	cfg, err := ini.Load(configPath)
	if err == nil {
		err = cfg.Section("adfs").MapTo(adfsConfig)
		checkError(err)
	}

	if val, ok := os.LookupEnv("ADFS_USER"); ok {
		adfsConfig.Username = val
	}
	if val, ok := os.LookupEnv("ADFS_PASS"); ok {
		adfsConfig.Password = val
	}
	if val, ok := os.LookupEnv("ADFS_HOST"); ok {
		adfsConfig.Hostname = val
	}

	return adfsConfig
}
{'fraction_non_alphanumeric': 0.14807872539831302, 'fraction_numerical': 0.0009372071227741331, 'mean_word_length': 4.505154639175258, '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': '1492680', 'n_tokens_mistral': 416, 'n_tokens_neox': 399, 'n_words': 89}