new lint help

This commit is contained in:
Barak Michener 2016-01-08 15:29:18 -05:00
parent 213c502aeb
commit 96e8a1d428
8 changed files with 481 additions and 70 deletions

View file

@ -1,3 +1,22 @@
#!/bin/bash
#!/usr/bin/env perl
use strict;
use warnings;
golint "$@" | grep -v "should have comment or be unexported"
my $a = join(" ", @ARGV);
my $cmd = "golint " . $a;
open(my $fh, '-|', $cmd)
or die "Could not run golint";
my $cnt = 0;
while (my $row = <$fh>) {
chomp $row;
if ($row !~ /should have comment or be unexported/) {
print "$row\n";
$cnt++;
}
}
if ($cnt > 0) {
exit 1;
}
exit 0;

View file

@ -21,4 +21,8 @@ gocode set lib-path \$SCRIPTPATH
cd src/$1
EOF
cat <<EOF > $2/.dir-locals.el.
((nil . ((eval . (setenv "GOPATH" "\`pwd\`")))))
EOF
git clone https://$1 $2/src/$1