2018-06-18 22:57:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
echo "Checking code quality (you want to see no output here)"
|
|
|
|
echo ""
|
|
|
|
|
|
|
|
echo ""
|
2024-01-02 23:17:59 +00:00
|
|
|
echo "Running staticcheck..."
|
2018-06-18 22:57:21 +00:00
|
|
|
|
2021-11-17 23:59:52 +00:00
|
|
|
staticcheck ./...
|
2018-06-29 19:20:07 +00:00
|
|
|
|
2024-01-02 23:17:59 +00:00
|
|
|
# In the future we should remove include-pkgs. However, there are a few false positives in the overall go stdlib that make this
|
2023-11-18 19:49:52 +00:00
|
|
|
# too noisy right now, specifically assigning nil to initialize slices (safe), and using go internal context channels assigned
|
|
|
|
# nil (also safe).
|
|
|
|
# We also have one file infinite_channel.go written in a way that static analysis cannot reason about easily. So it is explictly
|
|
|
|
# ignored.
|
2024-01-02 23:17:59 +00:00
|
|
|
echo "Running nilaway..."
|
|
|
|
nilaway -include-pkgs="cwtch.im/cwtch,cwtch.im/tapir,git.openprivacy.ca/openprivacy/connectivity" -exclude-file-docstrings="nolint:nilaway" ./...
|
2018-06-29 19:20:07 +00:00
|
|
|
|
|
|
|
echo "Time to format"
|
|
|
|
gofmt -l -s -w .
|
2019-01-28 20:09:25 +00:00
|
|
|
|
|
|
|
# ineffassign (https://github.com/gordonklaus/ineffassign)
|
2024-01-02 23:17:59 +00:00
|
|
|
# echo "Checking for ineffectual assignment of errors (unchecked errors...)"
|
|
|
|
# ineffassign .
|
2019-01-28 20:09:25 +00:00
|
|
|
|
2019-01-29 20:56:59 +00:00
|
|
|
# misspell (https://github.com/client9/misspell/cmd/misspell)
|
2024-01-02 23:17:59 +00:00
|
|
|
# echo "Checking for misspelled words..."
|
|
|
|
# misspell . | grep -v "testing/" | grep -v "vendor/" | grep -v "go.sum" | grep -v ".idea"
|