expectedError:stringPtr("invalid configuration for string-format: argument is not a slice [argument 0, option 0]")},
{
name:"Missing Regex",
config:lint.Arguments{
[]interface{}{
"method[0]"}},
expectedError:stringPtr("invalid configuration for string-format: less than two slices found in argument, scope and regex are required [argument 0, option 0]")},
{
name:"Bad Argument Type",
config:lint.Arguments{
[]interface{}{
1}},
expectedError:stringPtr("invalid configuration for string-format: less than two slices found in argument, scope and regex are required [argument 0, option 0]")},
expectedError:stringPtr("invalid configuration for string-format: regex is too small (regexes should begin and end with '/') [argument 0, option 1]")},
{
name:"Bad Scope",
config:lint.Arguments{
[]interface{}{
"1.a",
"//"}},
expectedError:stringPtr("failed to parse configuration for string-format: unable to parse rule scope [argument 0, option 0]")},
{
name:"Bad Regex",
config:lint.Arguments{
[]interface{}{
"method[1].a",
"/(/"}},
expectedError:stringPtr("failed to parse configuration for string-format: unable to compile /(/ as regexp [argument 0, option 1]")},
{
name:"Sample Config",
config:lint.Arguments{
[]interface{}{
"core.WriteError[1].Message","/^([^A-Z]$)/","must not start with a capital letter"},
[]interface{}{
"fmt.Errorf[0]","/^|[^\\.!?]$/","must not end in punctuation"},
[]interface{}{
"panic","/^[^\\n]*$/","must not contain line breaks"}}},