<commit_before>package config

import (
	"fmt"
	"os"
	"path"
	"path/filepath"
	"strings"

	"github.com/BurntSushi/toml"
	"github.com/cloudinsight/cloudinsight-agent/collector"
	"github.com/cloudinsight/cloudinsight-agent/common/log"
	"github.com/cloudinsight/cloudinsight-agent/common/plugin"
	"github.com/cloudinsight/cloudinsight-agent/common/util"
)

// VERSION sets the agent version here.
const VERSION = "0.3.0"

// NewConfig creates a new instance of Config.
func NewConfig(confPath string) (*Config, error) {
	c := &Config{}

	err := c.LoadConfig(confPath)
	if err != nil {
		return nil, fmt.Errorf("Failed to load the config file: %s", err)
	}

	if c.GlobalConfig.LicenseKey == "" {
		return nil, fmt.Errorf("LicenseKey must be specified in the config file.")
	}

	return c, nil
}

// Config represents cloudinsight-agent's configuration file.<commit_msg>Bump v0.4.0<commit_after>package config

import (
	"fmt"
	"os"
	"path"
	"path/filepath"
	"strings"

	"github.com/BurntSushi/toml"
	"github.com/cloudinsight/cloudinsight-agent/collector"
	"github.com/cloudinsight/cloudinsight-agent/common/log"
	"github.com/cloudinsight/cloudinsight-agent/common/plugin"
	"github.com/cloudinsight/cloudinsight-agent/common/util"
)

// VERSION sets the agent version here.
const VERSION = "0.4.0"

// NewConfig creates a new instance of Config.
func NewConfig(confPath string) (*Config, error) {
	c := &Config{}

	err := c.LoadConfig(confPath)
	if err != nil {
		return nil, fmt.Errorf("Failed to load the config file: %s", err)
	}

	if c.GlobalConfig.LicenseKey == "" {
		return nil, fmt.Errorf("LicenseKey must be specified in the config file.")
	}

	return c, nil
}

// Config represents cloudinsight-agent's configuration file.
{'fraction_non_alphanumeric': 0.13441483198146004, 'fraction_numerical': 0.005214368482039398, 'mean_word_length': 4.2975460122699385, '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': '81310', 'n_tokens_mistral': 623, 'n_tokens_neox': 608, 'n_words': 142}