-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support regular expression #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks awesome, thanks so much! Couple nits:
config.go
Outdated
return nil | ||
} | ||
|
||
func (c Config) findRule(path string) *Rule { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this and AliasFor
use *Config
too for consistency (see https://golang.org/doc/faq#methods_on_values_or_pointers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for review.
I fixed at 6439bcc
config.go
Outdated
return r.Regexp.ReplaceAllString(str, r.Alias), nil | ||
} | ||
|
||
return "", fmt.Errorf("mismatch rule") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can use errors.New
here since there are no actual formatting instructions in the error string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed at 6c1a7d7
Thanks @sachaos this is really cool! |
@julz Thank you! I've created PR to golangci-lint to enable to use this feature in that. |
Changes