new lint help
This commit is contained in:
parent
213c502aeb
commit
96e8a1d428
8 changed files with 481 additions and 70 deletions
23
bin/golintc
23
bin/golintc
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue