lint: linter for package docstrings (#59)

Fixes #38
This commit is contained in:
Michael McLoughlin
2019-01-22 21:14:59 -08:00
committed by GitHub
parent f1e854a1c0
commit 9c913ee847
4 changed files with 23 additions and 0 deletions

6
script/lib.sh Normal file
View File

@@ -0,0 +1,6 @@
# Print an error message to the terminal.
print_error() {
local red='\033[0;31m'
local nocolor='\033[0m'
printf "${red}error${nocolor}\t$1\n"
}

View File

@@ -15,3 +15,6 @@ golangci-lint run ./... ./examples/...
# Check asm declarations.
asmdecl ./...
# Custom linters.
./script/linter/pkgdoc

12
script/linter/pkgdoc Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash -e
source script/lib.sh
status=0
pkgs=$(go list -f '{{if not .Doc}}{{.ImportPath}}{{end}}' ./...)
for pkg in ${pkgs}; do
print_error "${pkg} missing docstring"
status=1
done
exit ${status}

View File

@@ -0,0 +1,2 @@
// Package issue50 tests for 32-bit MOVD/MOVQ instruction forms.
package issue50