Skip to content

Commit

Permalink
update static check TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrunde committed Nov 15, 2023
1 parent c52ccae commit ffa3a4d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 47 deletions.
13 changes: 7 additions & 6 deletions TODO.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ awk -F: '/.+/{files[$1]+=1;} END{for(f in files)print f" "files[f];}' <(staticch
staticcheck ./... >staticcheck.out
awk -F\: '/.+/{print "[ ]"$4}' staticcheck.out | sort -u -t \( -k2 -k1

[x] should use strings.Contains(".$", string(ch)) instead (S1003)
[x] should replace this if statement with an unconditional strings.TrimPrefix (S1017)
[x] should use fmt.Errorf(...) instead of errors.New(fmt.Sprintf(...)) (S1028)
[ ] "io/ioutil" has been deprecated since Go 1.19
[ ] should omit second index in slice, s[a
[ ] strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0
[ ] this value of file is never used (SA4006)
[ ] self-assignment of file to file (SA4018)
[ ] error strings should not be capitalized (ST1005)
[ ] error strings should not end with punctuation or a newline (ST1005)
[ ] field position is unused (U1000)
[ ] field value is unused (U1000)
[ ] error strings should not end with punctuation or newlines (ST1005)
[ ] func createChecksumFromZip is unused (U1000)
94 changes: 53 additions & 41 deletions staticcheck.out
Original file line number Diff line number Diff line change
@@ -1,47 +1,59 @@
api/github/github.go:62:13: error strings should not be capitalized (ST1005)
api/github/github.go:62:13: error strings should not end with punctuation or a newline (ST1005)
api/learn/learn.go:93:15: error strings should not be capitalized (ST1005)
api/learn/learn.go:114:15: error strings should not be capitalized (ST1005)
api/learn/learn.go:133:15: error strings should not be capitalized (ST1005)
api/learn/learn.go:192:10: error strings should not be capitalized (ST1005)
api/learn/preview.go:51:14: error strings should not be capitalized (ST1005)
api/github/github.go:62:13: error strings should not end with punctuation or newlines (ST1005)
api/learn/learn.go:81:15: error strings should not be capitalized (ST1005)
api/learn/learn.go:81:15: error strings should not end with punctuation or newlines (ST1005)
api/learn/learn.go:102:15: error strings should not be capitalized (ST1005)
api/learn/preview.go:63:16: error strings should not be capitalized (ST1005)
api/learn/preview.go:119:15: error strings should not be capitalized (ST1005)
api/learn/publish.go:80:19: error strings should not be capitalized (ST1005)
api/learn/publish.go:120:19: error strings should not be capitalized (ST1005)
api/learn/publish.go:156:13: error strings should not be capitalized (ST1005)
app/cmd/config.go:227:18: error strings should not be capitalized (ST1005)
app/cmd/config.go:227:18: error strings should not end with punctuation or a newline (ST1005)
app/cmd/config.go:395:24: error strings should not be capitalized (ST1005)
app/cmd/config.go:444:16: error strings should not be capitalized (ST1005)
app/cmd/config.go:478:24: error strings should not be capitalized (ST1005)
app/cmd/config.go:493:10: error strings should not end with punctuation or a newline (ST1005)
app/cmd/config.go:9:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019)
app/cmd/config.go:230:18: error strings should not be capitalized (ST1005)
app/cmd/config.go:230:18: error strings should not end with punctuation or newlines (ST1005)
app/cmd/config.go:361:41: strings.Title has been deprecated since Go 1.18 and an alternative has been available since Go 1.0: The rule Title uses for word boundaries does not handle Unicode punctuation properly. Use golang.org/x/text/cases instead. (SA1019)
app/cmd/config.go:405:16: error strings should not be capitalized (ST1005)
app/cmd/config.go:439:24: error strings should not be capitalized (ST1005)
app/cmd/config.go:454:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/config_test.go:5:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019)
app/cmd/guide.go:163:11: error strings should not be capitalized (ST1005)
app/cmd/guide.go:163:11: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:60:18: error strings should not be capitalized (ST1005)
app/cmd/markdown.go:60:18: error strings should not end with punctuation or a newline (ST1005)
app/cmd/markdown.go:106:10: error strings should not end with punctuation or a newline (ST1005)
app/cmd/markdown.go:111:10: error strings should not end with punctuation or a newline (ST1005)
app/cmd/markdown.go:114:10: error strings should not end with punctuation or a newline (ST1005)
app/cmd/markdown.go:60:18: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:106:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:111:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:114:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:119:10: error strings should not be capitalized (ST1005)
app/cmd/markdown.go:119:10: error strings should not end with punctuation or a newline (ST1005)
app/cmd/markdown.go:119:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:126:11: error strings should not be capitalized (ST1005)
app/cmd/markdown.go:126:11: error strings should not end with punctuation or a newline (ST1005)
app/cmd/markdown.go:126:11: error strings should not end with punctuation or newlines (ST1005)
app/cmd/markdown.go:131:11: error strings should not be capitalized (ST1005)
app/cmd/markdown.go:131:11: error strings should not end with punctuation or a newline (ST1005)
app/cmd/preview.go:417:16: error strings should not be capitalized (ST1005)
app/cmd/preview.go:428:16: error strings should not be capitalized (ST1005)
app/cmd/preview.go:457:34: error strings should not be capitalized (ST1005)
app/cmd/preview.go:479:22: error strings should not be capitalized (ST1005)
app/cmd/preview.go:485:23: error strings should not be capitalized (ST1005)
app/cmd/preview.go:538:14: error strings should not be capitalized (ST1005)
app/cmd/preview.go:556:14: error strings should not be capitalized (ST1005)
app/cmd/preview.go:643:22: error strings should not be capitalized (ST1005)
app/cmd/preview.go:643:22: error strings should not end with punctuation or a newline (ST1005)
app/cmd/preview.go:655:10: error strings should not end with punctuation or a newline (ST1005)
app/cmd/publish.go:210:22: error strings should not be capitalized (ST1005)
app/cmd/root.go:45:11: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:26:2: field value is unused (U1000)
mdresourceparser/md_resource_parser.go:27:2: field position is unused (U1000)
mdresourceparser/md_resource_parser.go:119:14: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:128:14: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:143:14: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:158:14: error strings should not be capitalized (ST1005)
app/cmd/markdown.go:131:11: error strings should not end with punctuation or newlines (ST1005)
app/cmd/preview.go:11:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019)
app/cmd/preview.go:63:29: error strings should not be capitalized (ST1005)
app/cmd/preview.go:76:29: error strings should not be capitalized (ST1005)
app/cmd/preview.go:91:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:118:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:123:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:273:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:289:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:312:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:322:11: error strings should not be capitalized (ST1005)
app/cmd/preview.go:487:16: error strings should not be capitalized (ST1005)
app/cmd/preview.go:498:16: error strings should not be capitalized (ST1005)
app/cmd/preview.go:695:46: error strings should not be capitalized (ST1005)
app/cmd/preview.go:740:10: error strings should not be capitalized (ST1005)
app/cmd/preview.go:740:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/preview.go:753:6: func createChecksumFromZip is unused (U1000)
app/cmd/preview.go:826:22: error strings should not be capitalized (ST1005)
app/cmd/preview.go:826:22: error strings should not end with punctuation or newlines (ST1005)
app/cmd/preview.go:838:10: error strings should not end with punctuation or newlines (ST1005)
app/cmd/preview.go:916:12: error strings should not be capitalized (ST1005)
app/cmd/preview.go:972:3: this value of file is never used (SA4006)
app/cmd/preview.go:975:4: self-assignment of file to file (SA4018)
app/cmd/preview.go:975:4: this value of file is never used (SA4006)
app/cmd/preview_test.go:7:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019)
app/cmd/publish.go:235:36: should omit second index in slice, s[a:len(s)] is identical to s[a:] (S1010)
app/cmd/publish.go:251:48: should omit second index in slice, s[a:len(s)] is identical to s[a:] (S1010)
app/cmd/root.go:6:2: "io/ioutil" has been deprecated since Go 1.19: As of Go 1.16, the same functionality is now provided by package [io] or package [os], and those implementations should be preferred in new code. See the specific function documentation for details. (SA1019)
app/cmd/root.go:44:11: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:181:14: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:190:14: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:205:14: error strings should not be capitalized (ST1005)
mdresourceparser/md_resource_parser.go:220:14: error strings should not be capitalized (ST1005)

0 comments on commit ffa3a4d

Please sign in to comment.