diff options
author | Zsolt Felfoldi <zsfelfoldi@gmail.com> | 2016-10-14 11:51:29 +0800 |
---|---|---|
committer | Felix Lange <fjl@twurst.com> | 2016-11-09 09:12:53 +0800 |
commit | 9f8d192991c4f68fa14c91366722bbca601da117 (patch) | |
tree | 5c1e089673d3f0208cd4a8208623bb95f29622c9 /vendor/github.com/aristanetworks/goarista/check_line_len.awk | |
parent | 760fd65487614b7a61443cd9371015925795f40f (diff) | |
download | go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.tar go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.tar.gz go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.tar.bz2 go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.tar.lz go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.tar.xz go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.tar.zst go-tangerine-9f8d192991c4f68fa14c91366722bbca601da117.zip |
les: light client protocol and API
Diffstat (limited to 'vendor/github.com/aristanetworks/goarista/check_line_len.awk')
-rwxr-xr-x | vendor/github.com/aristanetworks/goarista/check_line_len.awk | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/github.com/aristanetworks/goarista/check_line_len.awk b/vendor/github.com/aristanetworks/goarista/check_line_len.awk new file mode 100755 index 000000000..a9db53550 --- /dev/null +++ b/vendor/github.com/aristanetworks/goarista/check_line_len.awk @@ -0,0 +1,25 @@ +#!/usr/bin/awk -f +# Copyright (C) 2015 Arista Networks, Inc. +# Use of this source code is governed by the Apache License 2.0 +# that can be found in the COPYING file. + +BEGIN { + max = 100; +} + +# Expand tabs to 4 spaces. +{ + gsub(/\t/, " "); +} + +length() > max { + errors++; + print FILENAME ":" FNR ": Line too long (" length() "/" max ")"; +} + +END { + if (errors >= 125) { + errors = 125; + } + exit errors; +} |