Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Commit

Permalink
[#22] Introduce SingleQuote comment style
Browse files Browse the repository at this point in the history
  • Loading branch information
amorenojimenez authored and fbiville committed Jul 28, 2020
1 parent 1e1d0ad commit 85860a8
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"semicolon",
"rem",
"slashstarstar",
"xml"
"xml",
"singlequote"
]
},
"includes": {
Expand Down
1 change: 1 addition & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7
golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20181112210238-4b1f3b6b1646 h1:JEEoTsNEpPwxsebhPLC6P2jNr+6RFZLY4elUBVcMb+I=
Expand Down
1 change: 1 addition & 0 deletions internal/pkg/core/comment_style.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func SupportedStyles() []CommentStyle {
styles.Rem{},
styles.SlashStarStar{},
styles.Xml{},
styles.SingleQuote{},
}
}

Expand Down
2 changes: 2 additions & 0 deletions internal/pkg/core/comment_style_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ var _ = Describe("Comment styles", func() {
Entry("matches REM comment style", "REM", "", "", "REM "),
Entry("matches SlashStarStar comment style", "SlashStarStar", "/**", " */", " * "),
Entry("matches XML comment style", "XML", "<!--", "-->", ""),
Entry("matches SingleQuote comment style", "SingleQuote", "", "", "' "),
)

It("include only the following", func() {
Expand All @@ -57,6 +58,7 @@ var _ = Describe("Comment styles", func() {
"Hash",
"REM",
"SemiColon",
"SingleQuote",
"SlashSlash",
"SlashStar",
"SlashStarStar",
Expand Down
17 changes: 17 additions & 0 deletions internal/pkg/core/comment_styles/single_quote.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package styles

type SingleQuote struct {
}

func (SingleQuote) GetName() string {
return "SingleQuote"
}
func (SingleQuote) GetOpeningString() string {
return ""
}
func (SingleQuote) GetString() string {
return "' "
}
func (SingleQuote) GetClosingString() string {
return ""
}

0 comments on commit 85860a8

Please sign in to comment.