Commit 0c9cb2f2 authored by treyzania's avatar treyzania

Better docs for golint-sane.

parent 3ca2a344
#!/bin/bash
# Reminder: Go sucks, don't use it.
set -e
# Add more as needed.
go lint [email protected] \
| grep -v 'should have comment or be unexported' \
idreg='[a-zA-Z0-9_]+'
# Reasoning:
#
# 'should have comment or be unexported' : interface impls shouldn't need comments
# 'comment on exported' : don't tell me how to write comments
# "(var|struct field) $idreg should be" : don't tell me how to name my variables
# "func $idreg should be" : don't tell me how to name my functions
# "don't use ALL_CAPS" : don't tell me how to name my consts
# "error (var|const) $idreg .* of the form" : don't tell me how to name my errors
# 'error strings should not be capitalized' : don't tell me how to *write* my errors
# 'that stutters' : just fuck off
#
# Add more as needed. Reminder: Go sucks, don't use it.
golint [email protected] \
| grep -vE 'should have comment or be unexported' \
| grep -v 'comment on exported' \
| grep -vE '(var|struct field) [a-zA-Z0-9]+ should be'
| grep -vE "(var|struct field) $idreg should be" \
| grep -vE "func $idreg should be" \
| grep -v "don't use ALL_CAPS" \
| grep -vE "error (var|const) $idreg .* of the form" \
| grep -v 'error strings should not be capitalized' \
| grep -v 'that stutters'
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment