<commit_before>// Copyright (c) 2013-2020 mogemimi. Distributed under the MIT license.

package main

import (
	"bufio"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"strings"

	"github.com/pkg/errors"
)

func main() {
	var options struct {
		all bool
	}

	flag.BoolVar(&options.all, "all", false, "all file")
	flag.Parse()

	files, err := getFiles(flag.Args())
	if err != nil {
		log.Fatalln(err)
	}

	if options.all {
		if s, err := os.Stat("./include/Pomdog"); err != nil {
			log.Fatalln(err)
		} else if !s.IsDir() {
			log.Fatalln("include/Pomdog is not directory")
		}

		dirs := []string{
			"examples/*/*/*.hpp",
			"examples/*/*/*.cpp",
			"examples/*/*/*.mm",
			"examples/*/*/*/*.hpp",
			"examples/*/*/*/*.cpp",
			"include/Pomdog/*.hpp",
			"include/Pomdog/*/*.hpp",
			"include/Pomdog/*/*/*.hpp",
			"include/Pomdog/*/*/*/*.hpp",
			"src/*/*.hpp",
			"src/*/*.cpp",
			"src/*/*.mm",
			"src/*/*/*.hpp",
			"src/*/*/*.cpp",
			"src/*/*/*.mm",<commit_msg>Minor refactor<commit_after>// Copyright (c) 2013-2020 mogemimi. Distributed under the MIT license.

package main

import (
	"bufio"
	"flag"
	"fmt"
	"io/ioutil"
	"log"
	"os"
	"path/filepath"
	"strings"

	"github.com/pkg/errors"
)

func main() {
	var options struct {
		all bool
	}

	flag.BoolVar(&options.all, "all", false, "all file")
	flag.Parse()

	files, err := getFiles(flag.Args())
	if err != nil {
		log.Fatalln(err)
	}

	if options.all {
		if s, err := os.Stat("./include/Pomdog"); err != nil {
			log.Fatalln(err)
		} else if !s.IsDir() {
			log.Fatalln("include/Pomdog is not directory")
		}

		dirs := []string{
			"examples/*/*/*.hpp",
			"examples/*/*/*.cpp",
			"examples/*/*/*.mm",
			"examples/*/*/*/*.hpp",
			"examples/*/*/*/*.cpp",
			"examples/FeatureShowcase/Content/Shaders/*.glsl",
			"examples/FeatureShowcase/Content/Shaders/*.hlsl",
			"examples/FeatureShowcase/Content/Shaders/*.metal",
			"examples/QuickStart/Content/*.glsl",
			"examples/QuickStart/Content/*.hlsl",
			"examples/QuickStart/Content/*.metal",
			"include/Pomdog/*.hpp",
			"include/Pomdog/*/*.hpp",
			"include/Pomdog/*/*/*.hpp",
			"include/Pomdog/*/*/*/*.hpp",
			"src/*/*.hpp",
			"src/*/*.cpp",
			"src/*/*.mm",
			"src/*/*/*.hpp",
			"src/*/*/*.cpp",
			"src/*/*/*.mm",
{'fraction_non_alphanumeric': 0.25022222222222223, 'fraction_numerical': 0.0071111111111111115, 'mean_word_length': 2.874354561101549, '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': '6791122', 'n_tokens_mistral': 1064, 'n_tokens_neox': 927, 'n_words': 156}