-
-
Notifications
You must be signed in to change notification settings - Fork 23
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 good some minor liniting issues regards the exported types/func.
track/maintainer_config.go
Outdated
"os" | ||
) | ||
|
||
type MaintainerConfig struct { |
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.
Missing top level comment for exported types.
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.
Ah, I totally forgot to run the linter. My bad!
track/maintainer_config.go
Outdated
AvatarURL string `json:"avatar_url"` | ||
} | ||
|
||
func NewMaintainerConfig(path string) (MaintainerConfig, error) { |
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.
Same linting issue as exported types; missing comment.
track/maintainer_config.go
Outdated
|
||
func NewMaintainerConfig(path string) (MaintainerConfig, error) { | ||
mc := MaintainerConfig{} | ||
if _, err := os.Stat(path); os.IsNotExist(err) { |
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.
Very nice!
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestBrokenMaintainerConfig(t *testing.T) { |
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 like this test pattern. Short, simple, and clearly showcases how linting for the maintainers file works.
I've added the linting. Merging this in. Thanks @nywilken |
Now that we have a
maintainers.json
file, we're inevitably going to find that we delete fields without deleting the final comma. Or that someone adds the file to a track with a single maintainer, and makesmaintainers
an object rather than an array.This includes the
maintainers.json
in the linting process.