<commit_before>package main

import (
	"fmt"
	"github.com/spf13/cobra"
	"os"
	"path/filepath"
)

// Plugins
var goPlugin GoPlugin
var lessPlugin LessPlugin
var typescriptPlugin TypeScriptPlugin

var workdir string // Our working directory

// Commands

var rootCmd = &cobra.Command{
	Use:   "noodles",
	Short: "noodles is an opinionated manager for web apps.",
	Long: `noodles is an opinionated manager for web applications, enabling various functionality such as:
	- basic dependency management for built-in plugin support
	- compilation of project(s) in a configurable, ordered manner
	- configurable packing of project assets for distribution`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if cmd.Use != "new" { // If we're not potentially creating a new Noodles workspace
			if conf, readErr := ReadConfig(filepath.Join(workdir, "noodles.toml")); readErr == nil { // Read the config
				noodles = conf
			} else {
				fmt.Printf("noodles.toml appears to have the following issue(s):\n%s\n", readErr.Error())
				os.Exit(1)
			}
		}
	},
	DisableAutoGenTag: true,
}

// Main

func init() {
	var getWdErr error
	workdir, getWdErr = os.Getwd() // Get the current working directory

	if getWdErr != nil { // If we failed to get the current working directory
		fmt.Printf("Failed to get the current working directory: %s", getWdErr.Error())
		os.Exit(1)
	}

	rootCmd.AddCommand(buildCmd)
	rootCmd.AddCommand(checkCmd)
	rootCmd.AddCommand(genDocs)
	rootCmd.AddCommand(lintCmd)
	rootCmd.AddCommand(newCmd)
	rootCmd.AddCommand(packCmd)
	rootCmd.AddCommand(setupCmd)
	rootCmd.AddCommand(scriptCmd)
}

func main() {
	if err := rootCmd.Execute(); err != nil {
		os.Exit(1)
	}
}
<commit_msg>Do more granular checking in our PersistentPreRun<commit_after>package main

import (
	"fmt"
	"github.com/spf13/cobra"
	"os"
	"path/filepath"
)

// Plugins
var goPlugin GoPlugin
var lessPlugin LessPlugin
var typescriptPlugin TypeScriptPlugin

var workdir string // Our working directory

// Commands

var rootCmd = &cobra.Command{
	Use:   "noodles",
	Short: "noodles is an opinionated manager for web apps.",
	Long: `noodles is an opinionated manager for web applications, enabling various functionality such as:
	- basic dependency management for built-in plugin support
	- compilation of project(s) in a configurable, ordered manner
	- configurable packing of project assets for distribution`,
	PersistentPreRun: func(cmd *cobra.Command, args []string) {
		if cmd.Use != "new" || (cmd.Use == "new" && (newProjectName != "") || (newScriptName != "")) { // If we're not creating a new Noodles workspace
			if conf, readErr := ReadConfig(filepath.Join(workdir, "noodles.toml")); readErr == nil { // Read the config
				noodles = conf
			} else {
				fmt.Printf("noodles.toml appears to have the following issue(s):\n%s\n", readErr.Error())
				os.Exit(1)
			}
		}
	},
	DisableAutoGenTag: true,
}

// Main

func init() {
	var getWdErr error
	workdir, getWdErr = os.Getwd() // Get the current working directory

	if getWdErr != nil { // If we failed to get the current working directory
		fmt.Printf("Failed to get the current working directory: %s", getWdErr.Error())
		os.Exit(1)
	}

	rootCmd.AddCommand(buildCmd)
	rootCmd.AddCommand(checkCmd)
	rootCmd.AddCommand(genDocs)
	rootCmd.AddCommand(lintCmd)
	rootCmd.AddCommand(newCmd)
	rootCmd.AddCommand(packCmd)
	rootCmd.AddCommand(setupCmd)
	rootCmd.AddCommand(scriptCmd)
}

func main() {
	if err := rootCmd.Execute(); err != nil {
		os.Exit(1)
	}
}

{'fraction_non_alphanumeric': 0.11466971690020017, 'fraction_numerical': 0.0028595939376608523, 'mean_word_length': 4.213114754098361, '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': '1512739', 'n_tokens_mistral': 1214, 'n_tokens_neox': 1168, 'n_words': 343}