Skip to content

Commit

Permalink
feat: Format comments with a gray foreground
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Oct 29, 2024
1 parent bb11f5a commit b8333ac
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 94 deletions.
7 changes: 4 additions & 3 deletions cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"path/filepath"
"strings"

"github.com/clevyr/yampl/internal/colorize"
"gabe565.com/utils/coloryaml"
"github.com/clevyr/yampl/internal/config"
"github.com/clevyr/yampl/internal/util"
"github.com/clevyr/yampl/internal/visitor"
Expand Down Expand Up @@ -87,7 +87,7 @@ func run(cmd *cobra.Command, args []string) error {
return err
}

if err := colorize.WriteString(cmd.OutOrStdout(), s); err != nil {
if _, err := coloryaml.WriteString(cmd.OutOrStdout(), s); err != nil {
return err
}

Expand Down Expand Up @@ -192,7 +192,8 @@ func openAndTemplateFile(conf *config.Config, w io.Writer, path string) error {
}
}

return colorize.WriteString(w, s)
_, err := coloryaml.WriteString(w, s)
return err
}

temp, err := os.CreateTemp("", "yampl_*_"+filepath.Base(path))
Expand Down
5 changes: 3 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ module github.com/clevyr/yampl
go 1.23.2

require (
gabe565.com/utils v0.0.0-20241029174609-934fb3acf91e
github.com/Masterminds/sprig/v3 v3.3.0
github.com/dmarkham/enumer v1.5.10
github.com/fatih/color v1.18.0
github.com/goccy/go-yaml v1.13.0
github.com/lmittmann/tint v1.0.5
github.com/mattn/go-isatty v0.0.20
github.com/muesli/termenv v0.15.2
Expand All @@ -23,6 +22,8 @@ require (
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/goccy/go-yaml v1.13.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/huandu/xstrings v1.5.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
gabe565.com/utils v0.0.0-20241029174609-934fb3acf91e h1:UP9HzqvfJI8n6k2XIBe95pixGA36wFx3JiVbPa8RFJE=
gabe565.com/utils v0.0.0-20241029174609-934fb3acf91e/go.mod h1:i93PnuU9qG5dNr79l+206DXeYn+E6r7FrqNGSLhjrvw=
github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI=
github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver/v3 v3.3.0 h1:B8LGeaivUe71a5qox1ICM/JLl0NqZSW5CHyL+hmvYS0=
Expand All @@ -10,6 +12,8 @@ github.com/aymanbagabas/go-osc52/v2 v2.0.1 h1:HwpRHbFMcZLEVr42D4p7XBqjyuxQH5SMiE
github.com/aymanbagabas/go-osc52/v2 v2.0.1/go.mod h1:uYgXzlJ7ZpABp8OJ+exZzJJhRNQ2ASbcXHWsFqH8hp8=
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/creack/pty v1.1.23 h1:4M6+isWdcStXEf15G/RbrMPOQj1dZ7HPZCGwE4kOeP0=
github.com/creack/pty v1.1.23/go.mod h1:08sCNb52WyoAwi2QDyzUCTgcvVFhUzewun7wtTfvcwE=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/dmarkham/enumer v1.5.10 h1:ygL0L6quiTiH1jpp68DyvsWaea6MaZLZrTTkIS++R0M=
Expand Down
89 changes: 0 additions & 89 deletions internal/colorize/colorize.go

This file was deleted.

0 comments on commit b8333ac

Please sign in to comment.