2 # Copyright (c) 2013 Intel Corporation. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 if [ ! `which cpplint.py` ]; then
7 echo -e "\nPlease make sure cpplint.py is in your PATH. It is part of depot_tools inside Chromium repository."
11 if [ ! `which gjslint` ]; then
12 echo -e "\nPlease make sure gjslint (Google Closure Lint) is in your PATH."
13 echo -e "You can install it directly by \"sudo easy_install-2.7 http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz\"."
14 echo -e "Or visit https://developers.google.com/closure/utilities/docs/linter_howto for more information.\n"
18 # Store current dir and change to repository root dir.
20 SELF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
23 # FIXME(cmarcelo): the exception 'runtime/references' is for system_info/, we
24 # need to verify whether is really necessary or should be fixed.
25 FILTERS="-readability/streams,-runtime/references"
27 # TODO(cmarcelo): Skipping directories so we can enable style
28 # gradually, since it wasn't enforced before.
29 cpplint.py --filter="$FILTERS" $(find . \
30 ! -path './out*' ! -path './.git*' \
31 ! -path './demos' ! -path './examples' \
32 ! -path './packaging' \
33 ! -name 'XW_Extension*.h' \
34 ! -name 'picojson.*' \
35 \( -name '*.h' -o -name '*.cc' \) )
38 gjslint --strict --nojsdoc --max_line_length 100 --unix_mode $(find . \
39 ! -path './out*' ! -path './.git*' \
40 ! -path './packaging' \
45 # Return to previous dir and return the code returned by cpplint.py
49 if [ "x$CPP_RET_VAL" = "x0" -a "x$JS_RET_VAL" = "x0" ]; then