youtube/vitess — pull request #266 by enisoc (2014-12-19 21:50:27+00:00)
Title: Add git pre-submit hook for golint.

@alainjobart @aaijazi

Golint should never be required, as per the docs:

"""
The suggestions made by golint are exactly that: suggestions.
Golint is not perfect, and has both false positives and false negatives.
Do not treat its output as a gold standard. We will not be adding
pragmas or other knobs to suppress specific warnings, so do not expect or
require code to be completely "lint-free".
"""

This hook only shows the line count of the golint output for each file
modified in a commit. That way you don't get flooded just because you
changed one line in a file with a hundred pre-existing lint issues.

However, if we just print the warnings without stopping, you'll probably
never see them because your editor comes up to let you write a commit
message. So we try to steal back the keyboard and pause to let you know
you might want to look into the lint warnings. If the stealing ends up
being buggy, we'll have to think of something else.