fix: format code for linter
This commit is contained in:
parent
9796051136
commit
dd3b91408c
4 changed files with 24 additions and 23 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -50,4 +50,3 @@ dist/
|
||||||
|
|
||||||
# Windows Application Icon/Resource
|
# Windows Application Icon/Resource
|
||||||
*.syso
|
*.syso
|
||||||
mise/
|
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,14 @@ func TestInstallCommandArgs(t *testing.T) {
|
||||||
{
|
{
|
||||||
name: "no registry with one arg passes",
|
name: "no registry with one arg passes",
|
||||||
registry: "",
|
registry: "",
|
||||||
args: []string{"sioeed/picoclaw-skills/weather"},
|
args: []string{"sipeed/picoclaw-skills/weather"},
|
||||||
wantErr: false,
|
wantErr: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "no registry with no args fails",
|
name: "no registry with no args fails",
|
||||||
registry: "",
|
registry: "",
|
||||||
args: []string{},
|
args: []string{},
|
||||||
wantErr: true,
|
wantErr: true,
|
||||||
errContains: "exactly 1 argument",
|
errContains: "exactly 1 argument",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -393,7 +393,6 @@
|
||||||
},
|
},
|
||||||
"symlink_local": true
|
"symlink_local": true
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"max_concurrent_searches": 2,
|
"max_concurrent_searches": 2,
|
||||||
"search_cache": {
|
"search_cache": {
|
||||||
|
|
|
||||||
|
|
@ -11,10 +11,10 @@ import (
|
||||||
|
|
||||||
func TestIndexRegistryMapURL(t *testing.T) {
|
func TestIndexRegistryMapURL(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
mappings map[string]string
|
mappings map[string]string
|
||||||
inputURL string
|
inputURL string
|
||||||
expectedURL string
|
expectedURL string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "maps HTTP to fork",
|
name: "maps HTTP to fork",
|
||||||
|
|
@ -41,16 +41,16 @@ func TestIndexRegistryMapURL(t *testing.T) {
|
||||||
expectedURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
expectedURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "empty mappings returns original",
|
name: "empty mappings returns original",
|
||||||
mappings: map[string]string{},
|
mappings: map[string]string{},
|
||||||
inputURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
inputURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
||||||
expectedURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
expectedURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "nil mappings returns original",
|
name: "nil mappings returns original",
|
||||||
mappings: nil,
|
mappings: nil,
|
||||||
inputURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
inputURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
||||||
expectedURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
expectedURL: "https://raw.githubusercontent.com/keithy/angelhub/main/skills",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "first matching prefix wins",
|
name: "first matching prefix wins",
|
||||||
|
|
@ -106,10 +106,13 @@ func TestIndexRegistryIsURLAllowed(t *testing.T) {
|
||||||
expected: true,
|
expected: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "multiple prefixes first match wins",
|
name: "multiple prefixes first match wins",
|
||||||
allowedPrefixes: []string{"https://raw.githubusercontent.com/other/", "https://raw.githubusercontent.com/keithy/"},
|
allowedPrefixes: []string{
|
||||||
url: "https://raw.githubusercontent.com/keithy/angelhub/main",
|
"https://raw.githubusercontent.com/other/",
|
||||||
expected: true,
|
"https://raw.githubusercontent.com/keithy/",
|
||||||
|
},
|
||||||
|
url: "https://raw.githubusercontent.com/keithy/angelhub/main",
|
||||||
|
expected: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "prefix not at start returns false",
|
name: "prefix not at start returns false",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue