Skip to content

Commit

Permalink
fix(contribs/gnomd): patch dependencies, add linter, remove ioutils (#…
Browse files Browse the repository at this point in the history
…3575)

This is a PR primarily focused on updating direct and transitive
dependencies to address security patching for this tool, while this
doesn't currently include tests, I did add `make lint` in the same
pattern used by other contribs.

I also used the opportunity to remove `ioutil` in favor of the more
modern `io` and `os` functions that are supported in go stdLib moving
forward.
  • Loading branch information
n2p5 authored Jan 21, 2025
1 parent f0223be commit 92c41eb
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 39 deletions.
7 changes: 6 additions & 1 deletion contribs/gnomd/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
rundep := go run -modfile ../../misc/devdeps/go.mod
golangci_lint := $(rundep) github.com/golangci/golangci-lint/cmd/golangci-lint


.PHONY: install test lint
install:
go install .

test:
@echo "XXX: add tests"

lint:
@echo "XXX: add lint"
$(golangci_lint) --config ../../.github/golangci.yml run ./...
27 changes: 13 additions & 14 deletions contribs/gnomd/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,19 @@ require github.com/MichaelMure/go-term-markdown v0.1.4

require (
github.com/MichaelMure/go-term-text v0.3.1 // indirect
github.com/alecthomas/chroma v0.7.1 // indirect
github.com/danwakefield/fnmatch v0.0.0-20160403171240-cbb64ac3d964 // indirect
github.com/alecthomas/chroma v0.10.0 // indirect
github.com/disintegration/imaging v1.6.2 // indirect
github.com/dlclark/regexp2 v1.1.6 // indirect
github.com/dlclark/regexp2 v1.11.4 // indirect
github.com/eliukblau/pixterm/pkg/ansimage v0.0.0-20191210081756-9fb6cf8c2f75 // indirect
github.com/fatih/color v1.9.0 // indirect
github.com/gomarkdown/markdown v0.0.0-20191123064959-2c17d62f5098 // indirect
github.com/kyokomi/emoji/v2 v2.2.8 // indirect
github.com/lucasb-eyer/go-colorful v1.0.3 // indirect
github.com/mattn/go-colorable v0.1.4 // indirect
github.com/mattn/go-isatty v0.0.11 // indirect
github.com/mattn/go-runewidth v0.0.12 // indirect
github.com/rivo/uniseg v0.1.0 // indirect
golang.org/x/image v0.18.0 // indirect
golang.org/x/net v0.33.0 // indirect
golang.org/x/sys v0.28.0 // indirect
github.com/fatih/color v1.18.0 // indirect
github.com/gomarkdown/markdown v0.0.0-20241205020045-f7e15b2f3e62 // indirect
github.com/kyokomi/emoji/v2 v2.2.13 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mattn/go-colorable v0.1.14 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
golang.org/x/image v0.23.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sys v0.29.0 // indirect
)
50 changes: 29 additions & 21 deletions contribs/gnomd/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions contribs/gnomd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"fmt"
"io/ioutil"
"io"
"os"

markdown "github.com/MichaelMure/go-term-markdown"
Expand All @@ -11,14 +11,14 @@ import (
func main() {
// If no arguments are provided, read from stdin
if len(os.Args) <= 1 {
fileContent, err := ioutil.ReadAll(os.Stdin)
fileContent, err := io.ReadAll(os.Stdin)
checkErr(err)
renderMarkdown("stdin.gno", fileContent)
}

// Iterate through command-line arguments (file paths)
for _, filePath := range os.Args[1:] {
fileContent, err := ioutil.ReadFile(filePath)
fileContent, err := os.ReadFile(filePath)
checkErr(err)
renderMarkdown(filePath, fileContent)
}
Expand Down

0 comments on commit 92c41eb

Please sign in to comment.