Skip to content

Commit 745e371

Browse files
committed
Hold this tool to the family's lint bar
vet was the only static check running, and it does not see an unchecked write. golangci-lint does, and the shared .golangci.yml from tui-kit now runs in CI with nothing excluded wholesale. It found two things here, both the usage text writing to a flag set output that nobody checked, which now says so with `_, _ =`. Go 1.27.0 with the refreshed dependencies and tui-kit v0.2.1 comes with it, and go.mod is now where CI reads the Go version from. Dependabot takes over the routine bumps.
1 parent 34abbdb commit 745e371

6 files changed

Lines changed: 116 additions & 43 deletions

File tree

‎.github/dependabot.yml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Shared Dependabot configuration for the tui-tools family.
2+
#
3+
# Copy to .github/dependabot.yml at the root of the tool's repository. The
4+
# family pins nothing by hand, so this is what keeps a tool's dependencies and
5+
# its CI actions current between releases.
6+
#
7+
# No commit-message prefix is set on purpose: Dependabot's default subject
8+
# ("Bump x from a to b") already reads like the plain imperative sentences the
9+
# rest of the history is written in, and a "chore(deps):" prefix would be the
10+
# only conventional-commit line in the repository.
11+
version: 2
12+
13+
updates:
14+
# Go modules. Minor and patch updates arrive as one weekly pull request, so
15+
# the routine bumps cost one review. A major is left on its own, because it
16+
# is an API change that deserves to be read.
17+
- package-ecosystem: gomod
18+
directory: "/"
19+
schedule:
20+
interval: weekly
21+
open-pull-requests-limit: 5
22+
groups:
23+
go-deps:
24+
applies-to: version-updates
25+
update-types:
26+
- minor
27+
- patch
28+
29+
# The workflow's own actions, grouped the same way.
30+
- package-ecosystem: github-actions
31+
directory: "/"
32+
schedule:
33+
interval: weekly
34+
open-pull-requests-limit: 5
35+
groups:
36+
github-actions:
37+
patterns:
38+
- "*"

‎.github/workflows/ci.yml‎

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ jobs:
2222

2323
- uses: actions/setup-go@v5
2424
with:
25-
go-version: "1.26"
25+
# go.mod is the single place the family's Go version lives, so a
26+
# bump there moves CI with it.
27+
go-version-file: go.mod
2628
check-latest: true
2729

2830
- name: gofmt
@@ -37,6 +39,19 @@ jobs:
3739
- name: go vet
3840
run: go vet ./...
3941

42+
# The family's lint bar, shared as .golangci.yml. Nothing is excluded
43+
# wholesale: a deliberate finding carries a //nolint saying why.
44+
#
45+
# Built from source rather than downloaded: golangci-lint refuses a
46+
# module whose language version is newer than the Go it was built with,
47+
# and no released binary is built with 1.27 yet. goinstall compiles it
48+
# with the Go set up above, so the lint tracks the toolchain.
49+
- name: golangci-lint
50+
uses: golangci/golangci-lint-action@v8
51+
with:
52+
version: v2.13.2
53+
install-mode: goinstall
54+
4055
# The family's central promise — the command line you were shown is the
4156
# one that ran — only holds while a single package can start a process.
4257
# tui-kit ships the check, so every tool asserts the same boundary.
@@ -79,7 +94,9 @@ jobs:
7994

8095
- uses: actions/setup-go@v5
8196
with:
82-
go-version: "1.26"
97+
# go.mod is the single place the family's Go version lives, so a
98+
# bump there moves CI with it.
99+
go-version-file: go.mod
83100
check-latest: true
84101

85102
- name: build static linux/${{ matrix.goarch }}
@@ -128,7 +145,9 @@ jobs:
128145

129146
- uses: actions/setup-go@v5
130147
with:
131-
go-version: "1.26"
148+
# go.mod is the single place the family's Go version lives, so a
149+
# bump there moves CI with it.
150+
go-version-file: go.mod
132151
check-latest: true
133152

134153
- uses: goreleaser/goreleaser-action@v6

‎.golangci.yml‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Shared golangci-lint configuration for the tui-tools family.
2+
#
3+
# Copy to .golangci.yml at the root of the tool's repository, unchanged: every
4+
# tool in the family is held to the same bar, so a lint that passes here passes
5+
# everywhere. Nothing is excluded wholesale — a finding that is deliberate gets
6+
# a targeted //nolint on the line, with a comment saying why.
7+
version: "2"
8+
9+
linters:
10+
default: standard
11+
enable:
12+
- errcheck
13+
- govet
14+
- ineffassign
15+
- staticcheck
16+
- unused
17+
18+
formatters:
19+
enable:
20+
- gofmt

‎cmd/tui-firewall/main.go‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func parseFlags(args []string, out *os.File) (options, error) {
6666
"privilege escalation prefix, e.g. \"sudo -n\" or \"\" to disable")
6767
fs.BoolVar(&opts.showVersion, "version", false, "print the version and exit")
6868
fs.Usage = func() {
69-
fmt.Fprintf(out, "tui-firewall — a terminal UI for the system firewall\n\n"+
69+
_, _ = fmt.Fprintf(out, "tui-firewall — a terminal UI for the system firewall\n\n"+
7070
"Usage:\n tui-firewall [flags]\n\nFlags:\n")
7171
fs.PrintDefaults()
72-
fmt.Fprintf(out, "\nConfiguration is read from %s, then %s, "+
72+
_, _ = fmt.Fprintf(out, "\nConfiguration is read from %s, then %s, "+
7373
"then TUI_FIREWALL_* in the environment.\n",
7474
config.SystemPathFor(toolName), config.UserPathFor(toolName))
7575
}

‎go.mod‎

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
module github.com/tui-tools/tui-firewall
22

3-
go 1.26.3
3+
go 1.27.0
44

55
require (
66
github.com/charmbracelet/bubbles v1.0.0
77
github.com/charmbracelet/bubbletea v1.3.10
88
github.com/charmbracelet/lipgloss v1.1.0
9-
github.com/tui-tools/tui-kit v0.2.0
9+
github.com/tui-tools/tui-kit v0.2.1
1010
)
1111

1212
require (
1313
github.com/atotto/clipboard v0.1.4 // indirect
1414
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
15-
github.com/charmbracelet/colorprofile v0.4.1 // indirect
16-
github.com/charmbracelet/x/ansi v0.11.6 // indirect
15+
github.com/charmbracelet/colorprofile v0.4.3 // indirect
16+
github.com/charmbracelet/x/ansi v0.11.8 // indirect
1717
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
1818
github.com/charmbracelet/x/term v0.2.2 // indirect
19-
github.com/clipperhouse/displaywidth v0.9.0 // indirect
20-
github.com/clipperhouse/stringish v0.1.1 // indirect
21-
github.com/clipperhouse/uax29/v2 v2.5.0 // indirect
19+
github.com/clipperhouse/displaywidth v0.11.0 // indirect
20+
github.com/clipperhouse/uax29/v2 v2.7.0 // indirect
2221
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
23-
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
24-
github.com/mattn/go-isatty v0.0.20 // indirect
22+
github.com/lucasb-eyer/go-colorful v1.4.1 // indirect
23+
github.com/mattn/go-isatty v0.0.24 // indirect
2524
github.com/mattn/go-localereader v0.0.1 // indirect
26-
github.com/mattn/go-runewidth v0.0.19 // indirect
25+
github.com/mattn/go-runewidth v0.0.28 // indirect
2726
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
2827
github.com/muesli/cancelreader v0.2.2 // indirect
2928
github.com/muesli/termenv v0.16.0 // indirect
3029
github.com/rivo/uniseg v0.4.7 // indirect
31-
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
32-
golang.org/x/sys v0.38.0 // indirect
33-
golang.org/x/text v0.3.8 // indirect
30+
github.com/xo/terminfo v1.0.0 // indirect
31+
golang.org/x/sys v0.47.0 // indirect
32+
golang.org/x/text v0.41.0 // indirect
3433
)

‎go.sum‎

Lines changed: 22 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,30 @@ github.com/charmbracelet/bubbles v1.0.0 h1:12J8/ak/uCZEMQ6KU7pcfwceyjLlWsDLAxB5f
66
github.com/charmbracelet/bubbles v1.0.0/go.mod h1:9d/Zd5GdnauMI5ivUIVisuEm3ave1XwXtD1ckyV6r3E=
77
github.com/charmbracelet/bubbletea v1.3.10 h1:otUDHWMMzQSB0Pkc87rm691KZ3SWa4KUlvF9nRvCICw=
88
github.com/charmbracelet/bubbletea v1.3.10/go.mod h1:ORQfo0fk8U+po9VaNvnV95UPWA1BitP1E0N6xJPlHr4=
9-
github.com/charmbracelet/colorprofile v0.4.1 h1:a1lO03qTrSIRaK8c3JRxJDZOvhvIeSco3ej+ngLk1kk=
10-
github.com/charmbracelet/colorprofile v0.4.1/go.mod h1:U1d9Dljmdf9DLegaJ0nGZNJvoXAhayhmidOdcBwAvKk=
9+
github.com/charmbracelet/colorprofile v0.4.3 h1:QPa1IWkYI+AOB+fE+mg/5/4HRMZcaXex9t5KX76i20Q=
10+
github.com/charmbracelet/colorprofile v0.4.3/go.mod h1:/zT4BhpD5aGFpqQQqw7a+VtHCzu+zrQtt1zhMt9mR4Q=
1111
github.com/charmbracelet/lipgloss v1.1.0 h1:vYXsiLHVkK7fp74RkV7b2kq9+zDLoEU4MZoFqR/noCY=
1212
github.com/charmbracelet/lipgloss v1.1.0/go.mod h1:/6Q8FR2o+kj8rz4Dq0zQc3vYf7X+B0binUUBwA0aL30=
13-
github.com/charmbracelet/x/ansi v0.11.6 h1:GhV21SiDz/45W9AnV2R61xZMRri5NlLnl6CVF7ihZW8=
14-
github.com/charmbracelet/x/ansi v0.11.6/go.mod h1:2JNYLgQUsyqaiLovhU2Rv/pb8r6ydXKS3NIttu3VGZQ=
13+
github.com/charmbracelet/x/ansi v0.11.8 h1:JMFwp0CgDC2+jcOB162HH5k7I3FVbgFSMMYg7dSPBQQ=
14+
github.com/charmbracelet/x/ansi v0.11.8/go.mod h1:ZNN+3mXny/516oTQPLMPIBeSINvNJJQ8uQXDgbeJxY0=
1515
github.com/charmbracelet/x/cellbuf v0.0.15 h1:ur3pZy0o6z/R7EylET877CBxaiE1Sp1GMxoFPAIztPI=
1616
github.com/charmbracelet/x/cellbuf v0.0.15/go.mod h1:J1YVbR7MUuEGIFPCaaZ96KDl5NoS0DAWkskup+mOY+Q=
1717
github.com/charmbracelet/x/term v0.2.2 h1:xVRT/S2ZcKdhhOuSP4t5cLi5o+JxklsoEObBSgfgZRk=
1818
github.com/charmbracelet/x/term v0.2.2/go.mod h1:kF8CY5RddLWrsgVwpw4kAa6TESp6EB5y3uxGLeCqzAI=
19-
github.com/clipperhouse/displaywidth v0.9.0 h1:Qb4KOhYwRiN3viMv1v/3cTBlz3AcAZX3+y9OLhMtAtA=
20-
github.com/clipperhouse/displaywidth v0.9.0/go.mod h1:aCAAqTlh4GIVkhQnJpbL0T/WfcrJXHcj8C0yjYcjOZA=
21-
github.com/clipperhouse/stringish v0.1.1 h1:+NSqMOr3GR6k1FdRhhnXrLfztGzuG+VuFDfatpWHKCs=
22-
github.com/clipperhouse/stringish v0.1.1/go.mod h1:v/WhFtE1q0ovMta2+m+UbpZ+2/HEXNWYXQgCt4hdOzA=
23-
github.com/clipperhouse/uax29/v2 v2.5.0 h1:x7T0T4eTHDONxFJsL94uKNKPHrclyFI0lm7+w94cO8U=
24-
github.com/clipperhouse/uax29/v2 v2.5.0/go.mod h1:Wn1g7MK6OoeDT0vL+Q0SQLDz/KpfsVRgg6W7ihQeh4g=
19+
github.com/clipperhouse/displaywidth v0.11.0 h1:lBc6kY44VFw+TDx4I8opi/EtL9m20WSEFgwIwO+UVM8=
20+
github.com/clipperhouse/displaywidth v0.11.0/go.mod h1:bkrFNkf81G8HyVqmKGxsPufD3JhNl3dSqnGhOoSD/o0=
21+
github.com/clipperhouse/uax29/v2 v2.7.0 h1:+gs4oBZ2gPfVrKPthwbMzWZDaAFPGYK72F0NJv2v7Vk=
22+
github.com/clipperhouse/uax29/v2 v2.7.0/go.mod h1:EFJ2TJMRUaplDxHKj1qAEhCtQPW2tJSwu5BF98AuoVM=
2523
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f h1:Y/CXytFA4m6baUTXGLOoWe4PQhGxaX0KpnayAqC48p4=
2624
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f/go.mod h1:vw97MGsxSvLiUE2X8qFplwetxpGLQrlU1Q9AUEIzCaM=
27-
github.com/lucasb-eyer/go-colorful v1.3.0 h1:2/yBRLdWBZKrf7gB40FoiKfAWYQ0lqNcbuQwVHXptag=
28-
github.com/lucasb-eyer/go-colorful v1.3.0/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
29-
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
30-
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
25+
github.com/lucasb-eyer/go-colorful v1.4.1 h1:1EO+WB73+EH8EVbzlrG3KLAfEypQWVHIBqlTf+2hNss=
26+
github.com/lucasb-eyer/go-colorful v1.4.1/go.mod h1:R4dSotOR9KMtayYi1e77YzuveK+i7ruzyGqttikkLy0=
27+
github.com/mattn/go-isatty v0.0.24 h1:tGZZoVgT/KiqK1c8ocVLeDS8BSWMRd47J3Lbz7vsReI=
28+
github.com/mattn/go-isatty v0.0.24/go.mod h1:nMCL3Zebbrt45jsMDgnfIwz6ydEQApk5oEI3HqDio6A=
3129
github.com/mattn/go-localereader v0.0.1 h1:ygSAOl7ZXTx4RdPYinUpg6W99U8jWvWi9Ye2JC/oIi4=
3230
github.com/mattn/go-localereader v0.0.1/go.mod h1:8fBrzywKY7BI3czFoHkuzRoWE9C+EiG4R1k4Cjx5p88=
33-
github.com/mattn/go-runewidth v0.0.19 h1:v++JhqYnZuu5jSKrk9RbgF5v4CGUjqRfBm05byFGLdw=
34-
github.com/mattn/go-runewidth v0.0.19/go.mod h1:XBkDxAl56ILZc9knddidhrOlY5R/pDhgLpndooCuJAs=
31+
github.com/mattn/go-runewidth v0.0.28 h1:rPyg2ybwEKPebvpzVWe1gKBkH8EQFkxO4Y0hjBeLaBU=
32+
github.com/mattn/go-runewidth v0.0.28/go.mod h1:3qAiGCV4Koz/yuveO58qUefmUTRm8r0IGEXZ9jeHp/8=
3533
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 h1:ZK8zHtRHOkbHy6Mmr5D264iyp3TiX5OmNcI5cIARiQI=
3634
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6/go.mod h1:CJlz5H+gyd6CUWT45Oy4q24RdLyn7Md9Vj2/ldJBSIo=
3735
github.com/muesli/cancelreader v0.2.2 h1:3I4Kt4BQjOR54NavqnDogx/MIoWBFa0StPA8ELUXHmA=
@@ -40,15 +38,14 @@ github.com/muesli/termenv v0.16.0 h1:S5AlUN9dENB57rsbnkPyfdGuWIlkmzJjbFf0Tf5FWUc
4038
github.com/muesli/termenv v0.16.0/go.mod h1:ZRfOIKPFDYQoDFF4Olj7/QJbW60Ol/kL1pU3VfY/Cnk=
4139
github.com/rivo/uniseg v0.4.7 h1:WUdvkW8uEhrYfLC4ZzdpI2ztxP1I582+49Oc5Mq64VQ=
4240
github.com/rivo/uniseg v0.4.7/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
43-
github.com/tui-tools/tui-kit v0.2.0 h1:Ve3ke0R5H/aLz2Gl1KtaINWoPflSOIy+q3ZkHmiIeyw=
44-
github.com/tui-tools/tui-kit v0.2.0/go.mod h1:TxJSp9QVWZUNoc1r2cq6fbmJZaNbo5RH0aWl0KVL58g=
45-
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e h1:JVG44RsyaB9T2KIHavMF/ppJZNG9ZpyihvCd0w101no=
46-
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
41+
github.com/tui-tools/tui-kit v0.2.1 h1:VxOytZ4Agb8+/TiaW9k+Xy3uTkKKNyRM4LO+deu6iI8=
42+
github.com/tui-tools/tui-kit v0.2.1/go.mod h1:Vpg1NcQ5ktylMvXTzsixdHjLUNxhntR3ZYSOYaQ7/FQ=
43+
github.com/xo/terminfo v1.0.0 h1:2ZpYzqWzyyytjk3TP6aJVDhkMAkc99/1xKQdA3TDTBY=
44+
github.com/xo/terminfo v1.0.0/go.mod h1:RbqR21r5mrJuqunuUZ/Dhy/avygyECGrLceyNeo4LiM=
4745
golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI=
4846
golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo=
4947
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
50-
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
51-
golang.org/x/sys v0.38.0 h1:3yZWxaJjBmCWXqhN1qh02AkOnCQ1poK6oF+a7xWL6Gc=
52-
golang.org/x/sys v0.38.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
53-
golang.org/x/text v0.3.8 h1:nAL+RVCQ9uMn3vJZbV+MRnydTJFPf8qqY42YiA6MrqY=
54-
golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ=
48+
golang.org/x/sys v0.47.0 h1:o7XGOvZQCADBQQ4Y7VNq2dRWQR7JmOUW8Kxx4ZsNgWs=
49+
golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
50+
golang.org/x/text v0.41.0 h1:vz/seA0lnX87Othu2f/0L24RcgrXD9/YFTSuGjj3rH8=
51+
golang.org/x/text v0.41.0/go.mod h1:jvf1O8ajNzZqhSrQBPbutR/EB83Cc0CFrezNQIwbb5M=

0 commit comments

Comments
 (0)