aboutsummaryrefslogtreecommitdiff
path: root/cmd/kdev/main.go
diff options
context:
space:
mode:
authorMartin Kagamino Lehoux <martin@lehoux.net>2024-10-15 10:06:45 +0200
committerMartin Kagamino Lehoux <martin@lehoux.net>2024-10-15 10:06:45 +0200
commite0d7a9625714a6194bb8a21729efae72dea93729 (patch)
treef87cc682af0400bdd2150e8b496dbfa722ab9562 /cmd/kdev/main.go
parentc1ae71251a2b23170a5d42c6acd37cad8675c5f0 (diff)
feat(kdev): Default excludes
Diffstat (limited to 'cmd/kdev/main.go')
-rw-r--r--cmd/kdev/main.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/cmd/kdev/main.go b/cmd/kdev/main.go
index 8f7e4a9..94d4d72 100644
--- a/cmd/kdev/main.go
+++ b/cmd/kdev/main.go
@@ -35,6 +35,11 @@ var repoPath = flag.String("repo", ".", "Path to the repository")
var afterS = flag.String("after", "2022-09-01", "Only show records after this date")
var algo = flag.String("algo", "git", "Record extraction algorithm (git, go-git, stat)")
+var excludes map[string]bool = map[string]bool{
+ ".git": true,
+ ".kdev.yaml": true,
+}
+
func main() {
var err error
flag.Parse()
@@ -57,7 +62,9 @@ func main() {
kcore.Expect(err, "Error opening config file")
defer configFile.Close()
kcore.Expect(viper.ReadConfig(configFile), "Error reading config file")
- excludes := viper.GetStringSlice("excludes")
+ for _, exclude := range viper.GetStringSlice("excludes") {
+ excludes[exclude] = true
+ }
keywords := viper.GetStringSlice("keywords")
repo, err := git.PlainOpen(path.Join(*repoPath, ".git"))
kcore.Expect(err, "Error opening repository")
@@ -72,7 +79,7 @@ func main() {
if err != nil {
return err
}
- if slices.Contains(excludes, d.Name()) {
+ if excludes[d.Name()] {
if d.IsDir() {
return filepath.SkipDir
} else {