Skip to content

Commit 7dc4d33

Browse files
✨ add new extension to markers in order to allow work with .yml
1 parent 0a807f4 commit 7dc4d33

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pkg/model/file/marker.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ var commentsByExt = map[string]string{
2828
// this is a backwards incompatible change, and thus should be done for next project version.
2929
".go": "// ",
3030
".yaml": "# ",
31+
".yml": "#",
3132
// When adding additional file extensions, update also the NewMarkerFor documentation and error
3233
}
3334

@@ -38,14 +39,14 @@ type Marker struct {
3839
}
3940

4041
// NewMarkerFor creates a new marker customized for the specific file
41-
// Supported file extensions: .go, .ext
42+
// Supported file extensions: .go, .yaml, .yml
4243
func NewMarkerFor(path string, value string) Marker {
4344
ext := filepath.Ext(path)
4445
if comment, found := commentsByExt[ext]; found {
4546
return Marker{comment, value}
4647
}
4748

48-
panic(fmt.Errorf("unknown file extension: '%s', expected '.go' or '.yaml'", ext))
49+
panic(fmt.Errorf("unknown file extension: '%s', expected '.go', '.yaml' or '.yml'", ext))
4950
}
5051

5152
// String implements Stringer

0 commit comments

Comments
 (0)