Skip to content

Commit cc21648

Browse files
authored
Run deadcode detection as part of linting (#101)
Since this is essentially a form of linting, run it along with all the other linting ops.
1 parent 51da195 commit cc21648

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Taskfile.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,12 @@ tasks:
9797
silent: true
9898
cmds:
9999
- cmd: |
100-
if test -z "$(deadcode -test ./...)"; then
100+
output=$(deadcode -test ./...)
101+
if test -z "$output"; then
101102
echo "✅ No unused code found"
102103
else
103104
echo "❌ Unused code found"
105+
echo $output
104106
exit 1
105107
fi
106108
silent: true
@@ -114,15 +116,21 @@ tasks:
114116
silent: true
115117
- task: install-deadcode
116118
silent: true
119+
- task: deadcode
117120
cmds:
118121
- golangci-lint run ./...
119122
- go vet ./...
120123

121124
lint-fix:
122125
desc: Run linting tools, and apply fixes.
123126
deps:
127+
- task: gen
128+
silent: true
124129
- task: install-golangci-lint
125130
silent: true
131+
- task: install-deadcode
132+
silent: true
133+
- task: deadcode
126134
cmds:
127135
- golangci-lint run --fix ./...
128136

0 commit comments

Comments
 (0)