Fix linting issues in manifest.go and plugin_test.go
- Add blank line before return statement in manifest.go - Fix table formatting alignment in plugin_test.go 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
278958d1e4
commit
03c521f237
2 changed files with 41 additions and 40 deletions
|
@ -44,6 +44,7 @@ func RunManifestCommand(args []string, pluginPath string) error {
|
|||
case "check":
|
||||
if err := manifest.IsValid(); err != nil {
|
||||
Logger.Error("Plugin manifest validation failed", "error", err)
|
||||
|
||||
return err
|
||||
}
|
||||
Logger.Info("Plugin manifest is valid")
|
||||
|
|
|
@ -521,73 +521,73 @@ func TestParsePluginCtlConfig(t *testing.T) {
|
|||
|
||||
func TestIsPathIgnored(t *testing.T) {
|
||||
tests := []struct {
|
||||
name string
|
||||
relativePath string
|
||||
ignorePatterns []string
|
||||
expectedIgnore bool
|
||||
name string
|
||||
relativePath string
|
||||
ignorePatterns []string
|
||||
expectedIgnore bool
|
||||
expectedPattern string
|
||||
}{
|
||||
{
|
||||
name: "No ignore patterns",
|
||||
relativePath: "webapp/dist/main.js",
|
||||
ignorePatterns: []string{},
|
||||
expectedIgnore: false,
|
||||
name: "No ignore patterns",
|
||||
relativePath: "webapp/dist/main.js",
|
||||
ignorePatterns: []string{},
|
||||
expectedIgnore: false,
|
||||
expectedPattern: "",
|
||||
},
|
||||
{
|
||||
name: "Direct file match",
|
||||
relativePath: "test.js",
|
||||
ignorePatterns: []string{"*.js"},
|
||||
expectedIgnore: true,
|
||||
name: "Direct file match",
|
||||
relativePath: "test.js",
|
||||
ignorePatterns: []string{"*.js"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "*.js",
|
||||
},
|
||||
{
|
||||
name: "Directory pattern with slash",
|
||||
relativePath: "build/output.js",
|
||||
ignorePatterns: []string{"build/"},
|
||||
expectedIgnore: true,
|
||||
name: "Directory pattern with slash",
|
||||
relativePath: "build/output.js",
|
||||
ignorePatterns: []string{"build/"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "build/",
|
||||
},
|
||||
{
|
||||
name: "Directory pattern without slash",
|
||||
relativePath: "build/output.js",
|
||||
ignorePatterns: []string{"build"},
|
||||
expectedIgnore: true,
|
||||
name: "Directory pattern without slash",
|
||||
relativePath: "build/output.js",
|
||||
ignorePatterns: []string{"build"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "build",
|
||||
},
|
||||
{
|
||||
name: "Nested directory match",
|
||||
relativePath: "webapp/dist/main.js",
|
||||
ignorePatterns: []string{"dist"},
|
||||
expectedIgnore: true,
|
||||
name: "Nested directory match",
|
||||
relativePath: "webapp/dist/main.js",
|
||||
ignorePatterns: []string{"dist"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "dist",
|
||||
},
|
||||
{
|
||||
name: "Multiple patterns - first match",
|
||||
relativePath: "test.js",
|
||||
ignorePatterns: []string{"*.js", "*.css"},
|
||||
expectedIgnore: true,
|
||||
name: "Multiple patterns - first match",
|
||||
relativePath: "test.js",
|
||||
ignorePatterns: []string{"*.js", "*.css"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "*.js",
|
||||
},
|
||||
{
|
||||
name: "Multiple patterns - second match",
|
||||
relativePath: "style.css",
|
||||
ignorePatterns: []string{"*.js", "*.css"},
|
||||
expectedIgnore: true,
|
||||
name: "Multiple patterns - second match",
|
||||
relativePath: "style.css",
|
||||
ignorePatterns: []string{"*.js", "*.css"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "*.css",
|
||||
},
|
||||
{
|
||||
name: "No match",
|
||||
relativePath: "README.md",
|
||||
ignorePatterns: []string{"*.js", "*.css"},
|
||||
expectedIgnore: false,
|
||||
name: "No match",
|
||||
relativePath: "README.md",
|
||||
ignorePatterns: []string{"*.js", "*.css"},
|
||||
expectedIgnore: false,
|
||||
expectedPattern: "",
|
||||
},
|
||||
{
|
||||
name: "Complex path with match",
|
||||
relativePath: "webapp/node_modules/package/file.js",
|
||||
ignorePatterns: []string{"node_modules"},
|
||||
expectedIgnore: true,
|
||||
name: "Complex path with match",
|
||||
relativePath: "webapp/node_modules/package/file.js",
|
||||
ignorePatterns: []string{"node_modules"},
|
||||
expectedIgnore: true,
|
||||
expectedPattern: "node_modules",
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue