Skip to content

Commit

Permalink
feat: enable wildcard enum (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
aristosvo authored Oct 30, 2024
1 parent d224885 commit 6f65c77
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions internal/x/text/cases.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ func (c *Caser) Identifierize(s string) string {
return "Blank"
}

if s == "*" {
return "Wildcard"
}

// FIXME: Better handling of non-identifier chars.
var sb strings.Builder
for _, part := range splitIdentifierByCaseAndSeparators(s) {
Expand Down
8 changes: 8 additions & 0 deletions tests/data/misc/specialCharacters/specialCharacters.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions tests/data/misc/specialCharacters/specialCharacters.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
"type": "string",
"enum": [
"GPL-3.0",
"MIT"
"MIT",
"*"
]
},
"plusLicenses": {
"type": "string",
"enum": [
"GPL-3.0+",
"MIT+"
"MIT+",
"*"
]
},
"plainLicensesRef": {
Expand All @@ -35,14 +37,16 @@
"type": "string",
"enum": [
"GPL-3.0",
"MIT"
"MIT",
"*"
]
},
"license+": {
"type": "string",
"enum": [
"GPL-3.0+",
"MIT+"
"MIT+",
"*"
]
}
}
Expand Down

0 comments on commit 6f65c77

Please sign in to comment.