add ability for setting custom tools options (#44)

* feat(gotests): add custom templates support

* feat(struct_tags): add support for custom `transform` option
This commit is contained in:
Smirnov Oleksandr 2023-08-17 19:13:56 +03:00 committed by GitHub
parent 2e89cea6f3
commit e0a3e70e48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 36 additions and 4 deletions

View file

@ -1,6 +1,14 @@
---@type gopher.Config
local config = {}
---@alias gopher.ConfigGoTagTransform
---| "snakecase" "GopherUser" -> "gopher_user"
---| "camelcase" "GopherUser" -> "gopherUser"
---| "lispcase" "GopherUser" -> "gopher-user"
---| "pascalcase" "GopherUser" -> "GopherUser"
---| "titlecase" "GopherUser" -> "Gopher User"
---| "keep" keeps the original field name
---@class gopher.Config
local default_config = {
---@class gopher.ConfigCommand
@ -12,6 +20,19 @@ local default_config = {
iferr = "iferr",
dlv = "dlv",
},
---@class gopjer.ConfigGotests
gotests = {
-- gotests doesn't have template named "default" so this plugin uses "default" to set the default template
template = "default",
-- path to a directory containing custom test code templates
---@type string|nil
template_dir = nil,
},
---@class gopher.ConfigGoTag
gotag = {
---@type gopher.ConfigGoTagTransform
transform = "snakecase",
},
}
---@type gopher.Config