add omit test files and only frontend
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
// internal/walker/walker.go
|
||||
package walker
|
||||
|
||||
import (
|
||||
@@ -20,6 +21,7 @@ type Result struct {
|
||||
Entries []Entry
|
||||
AbsRoot string
|
||||
SingleFile bool
|
||||
OmitTest bool
|
||||
}
|
||||
|
||||
func Run(cfg *config.Config) (*Result, error) {
|
||||
@@ -43,6 +45,7 @@ func processSingleFile(cfg *config.Config) (*Result, error) {
|
||||
MaxSize: cfg.MaxSize,
|
||||
Extensions: cfg.Extensions,
|
||||
Ignores: cfg.Ignores,
|
||||
OmitTest: cfg.OmitTest,
|
||||
}
|
||||
|
||||
if flt.ShouldSkipFile(cfg.AbsRoot, filepath.Base(cfg.AbsRoot), info) {
|
||||
@@ -53,8 +56,8 @@ func processSingleFile(cfg *config.Config) (*Result, error) {
|
||||
Entries: []Entry{{RelPath: filepath.Base(cfg.AbsRoot), Size: info.Size()}},
|
||||
AbsRoot: filepath.Dir(cfg.AbsRoot),
|
||||
SingleFile: true,
|
||||
OmitTest: cfg.OmitTest,
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
func walkDirectory(cfg *config.Config) (*Result, error) {
|
||||
@@ -62,9 +65,10 @@ func walkDirectory(cfg *config.Config) (*Result, error) {
|
||||
MaxSize: cfg.MaxSize,
|
||||
Extensions: cfg.Extensions,
|
||||
Ignores: cfg.Ignores,
|
||||
OmitTest: cfg.OmitTest,
|
||||
}
|
||||
|
||||
result := &Result{AbsRoot: cfg.AbsRoot}
|
||||
result := &Result{AbsRoot: cfg.AbsRoot, OmitTest: cfg.OmitTest}
|
||||
|
||||
err := filepath.WalkDir(cfg.AbsRoot, func(path string, d fs.DirEntry, err error) error {
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user