From c7a753887de350f7c08d1ceea198749c83907428 Mon Sep 17 00:00:00 2001 From: Rogee Date: Tue, 23 Sep 2025 15:34:04 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=81=E8=AE=B8=E8=A7=A3=E6=9E=90?= =?UTF-8?q?=E7=94=9F=E6=88=90=E6=96=87=E4=BB=B6=EF=BC=8C=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BB=A5=E6=94=AF=E6=8C=81=20.gen.go=20?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg/ast/provider/config.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/ast/provider/config.go b/pkg/ast/provider/config.go index f5a8c5f..ba67eb7 100644 --- a/pkg/ast/provider/config.go +++ b/pkg/ast/provider/config.go @@ -6,6 +6,8 @@ import ( "os" "path/filepath" "strings" + + log "github.com/sirupsen/logrus" ) // ParserConfig represents the configuration for the parser @@ -77,7 +79,7 @@ func NewParserConfig() *ParserConfig { StrictMode: false, DefaultMode: "basic", AllowTestFiles: false, - AllowGenFiles: false, + AllowGenFiles: true, MaxFileSize: 10 * 1024 * 1024, // 10MB Concurrency: 1, CacheEnabled: true, @@ -115,12 +117,9 @@ func (c *ParserContext) ShouldIncludeFile(filePath string) bool { } // Skip generated files if not allowed, but allow routes.gen.go and services.gen.go since they may contain providers - if !c.Config.AllowGenFiles { + if !c.Config.AllowGenFiles && strings.HasSuffix(filePath, ".gen.go") { return false } - // if !c.Config.AllowGenFiles && strings.HasSuffix(filePath, ".gen.go") && !strings.HasSuffix(filePath, "routes.gen.go") && !strings.HasSuffix(filePath, "services.gen.go") { - // return false - // } // Check file size if info, err := os.Stat(filePath); err == nil { @@ -132,6 +131,7 @@ func (c *ParserContext) ShouldIncludeFile(filePath string) bool { // TODO: Implement include/exclude pattern matching // For now, include all Go files that pass the basic checks + log.Debugf("Including file in parsing: %s", filePath) return true }