~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to extra/run_cpplint.sh

  • Committer: Brian Aker
  • Date: 2009-10-15 18:32:22 UTC
  • mfrom: (1130.3.47 memory-file-moves)
  • Revision ID: brian@gaz-20091015183222-n79fjde41epz9u6g
Merge memory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/env bash
 
2
#  Copyright (C) 2009 Sun Microsystems, Inc
 
3
#
 
4
#  This program is free software; you can redistribute it and/or modify
 
5
#  it under the terms of the GNU General Public License as published by
 
6
#  the Free Software Foundation; version 2 of the License.
 
7
#
 
8
#  This program is distributed in the hope that it will be useful,
 
9
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
#  GNU General Public License for more details.
 
12
#
 
13
#  You should have received a copy of the GNU General Public License
 
14
#  along with this program; if not, write to the Free Software
 
15
#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
16
 
 
17
export ACK_OPTIONS="--nomake --type-set drizzle=.yy,.am,.ac,.m4,.i,.ic --drizzle --cc --cpp --py"
 
18
 
 
19
# If srcdir is set, that means that we're in a distcheck build, and need to
 
20
# operate in that context.
 
21
if test "x${srcdir}" != "x" ; then
 
22
  cd ${srcdir}
 
23
fi
 
24
 
 
25
ACK=`which ack-grep`
 
26
if test "x$ACK" = "x" ; then
 
27
  ACK=`which ack`
 
28
  if test "x$ACK" = "x" ; then
 
29
    echo "WARNING: Neither ack-grep nor ack found on your system."
 
30
    echo "WARNING: Skipping cpplint checks."
 
31
    exit 0
 
32
  fi
 
33
fi
 
34
    
 
35
command="python extra/cpplint.py  --filter=-whitespace,-runtime,-readability,+legal,-build,+build/header_guard,+build/include_config,+build/namespaces"
 
36
if test "x$1" = "x" ; then
 
37
  ${ACK} -g . | grep -v innobase | grep -v gnulib | grep -v '\.pb\.'| grep -v bak-header | grep -v '^intl' | grep -v '^config' | grep -v '\.am$' | grep -v '\.ac$' | grep -v m4 | grep -v sql_yacc.yy | grep -v '.gperf$' | grep -v 'drizzled/probes.h' | grep -v 'drizzled/function_hash.h' | grep -v 'drizzled/symbol_hash.h' | grep -v 'util/dummy.cc' | grep -v 'drizzled/sql_yacc.h' | grep -v 'drizzled/configmake.h' | xargs $command
 
38
else
 
39
  $command $1
 
40
fi
 
41
retval=$?
 
42
if test ${retval} -ne 0 ; then
 
43
  echo "ERROR: cpplint found errors in the tree... please see output above"
 
44
  exit ${retval}
 
45
fi
 
46