2012-05-03 20:58:51 -04:00
|
|
|
#!/bin/sh
|
|
|
|
# Code quality tool; check line length of each file in certain directories
|
|
|
|
#
|
2014-01-20 22:55:29 -05:00
|
|
|
# Copyright (C) 2012, 2013, 2014 Mike Gerwitz
|
2012-05-03 20:58:51 -04:00
|
|
|
#
|
2013-12-22 09:37:21 -05:00
|
|
|
# This file is part of GNU ease.js.
|
2012-05-03 20:58:51 -04:00
|
|
|
#
|
2012-05-11 19:07:44 -04:00
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
2012-05-03 20:58:51 -04:00
|
|
|
#
|
2012-05-11 19:07:44 -04:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2014-01-16 00:04:26 -05:00
|
|
|
#
|
|
|
|
# For a list of ignored patterns, see chk-linelen-ignores
|
2012-05-03 20:58:51 -04:00
|
|
|
##
|
|
|
|
|
|
|
|
root="${1:-.}"
|
|
|
|
|
|
|
|
hideignores()
|
|
|
|
{
|
|
|
|
grep -v "$(
|
|
|
|
sed '/^#/d;
|
|
|
|
s/\n/|/g;
|
|
|
|
s/|$//;
|
|
|
|
' "$root/tools/linechk-ignores"
|
|
|
|
)"
|
|
|
|
}
|
|
|
|
|
|
|
|
# output all file with lines > 80 characters and exit successfully if grep has a
|
|
|
|
# non-zero status code, indicating that no matches were found
|
|
|
|
cd "$root" && \
|
2014-01-16 00:04:26 -05:00
|
|
|
find lib/ tools/ test/ doc/ README* Makefile.am configure.ac *.js \
|
2012-05-03 20:58:51 -04:00
|
|
|
-type f -exec wc -L {} \; \
|
|
|
|
| hideignores \
|
2014-01-16 00:07:46 -05:00
|
|
|
| grep -v '^\([0-6][0-9]\?\|7[0-6]\) ' \
|
2012-05-03 20:58:51 -04:00
|
|
|
|| exit 0
|