Skip to content

Commit

Permalink
It is not a purpose of walker
Browse files Browse the repository at this point in the history
  • Loading branch information
kachick committed Aug 23, 2023
1 parent 786c70f commit 0222807
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 deletions.
9 changes: 5 additions & 4 deletions cmd/fmt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@
package main

import (
"dotfiles/internal/constants"
"dotfiles/internal/fileutils"
"dotfiles/internal/runner"
)

func main() {
wr := fileutils.GetWalker()
walker := fileutils.GetWalker()

bashPaths := wr.GetAllBash()
nixPaths := wr.GetAllNix()
bashPaths := walker.GetAllBash()
nixPaths := walker.GetAllNix()

// Do not cover the same files in another formatter for parallel processing
cmds := runner.Commands{
{Path: "dprint", Args: []string{"fmt"}},
{Path: "shfmt", Args: append([]string{"--language-dialect", "bash", "--write"}, bashPaths...)},
{Path: "nixpkgs-fmt", Args: nixPaths},
{Path: "typos", Args: append(fileutils.GetTyposTargetedRoots(), "--write-changes")},
{Path: "typos", Args: append(constants.GetTyposTargetedRoots(), "--write-changes")},
{Path: "go", Args: []string{"fmt", "./..."}},
}

Expand Down
3 changes: 2 additions & 1 deletion cmd/lint/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package main

import (
"dotfiles/internal/constants"
"dotfiles/internal/fileutils"
"dotfiles/internal/runner"
)
Expand All @@ -18,7 +19,7 @@ func main() {
{Path: "shfmt", Args: append([]string{"--language-dialect", "bash", "--diff"}, bashPaths...)},
{Path: "shellcheck", Args: bashPaths},
{Path: "nixpkgs-fmt", Args: append([]string{"--check"}, nixPaths...)},
{Path: "typos", Args: fileutils.GetTyposTargetedRoots()},
{Path: "typos", Args: constants.GetTyposTargetedRoots()},
{Path: "gitleaks", Args: []string{"detect"}},
{Path: "go", Args: []string{"vet", "./..."}},
}
Expand Down
9 changes: 9 additions & 0 deletions internal/constants/main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package constants

func GetTyposTargetedRoots() []string {
return []string{
".",
".github", ".vscode",
"home/.config", "home/.stack",
}
}
8 changes: 0 additions & 8 deletions internal/fileutils/walker.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,6 @@ import (
"golang.org/x/exp/slices"
)

func GetTyposTargetedRoots() []string {
return []string{
".",
".github", ".vscode",
"home/.config", "home/.stack",
}
}

type WalkedReport struct {
Path string
Dir fs.DirEntry
Expand Down

0 comments on commit 0222807

Please sign in to comment.