File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change 2
2
3
3
set -e
4
4
5
+ script_folder=` dirname $0 `
6
+
5
7
if [[ " $# " -ne 2 ]]
6
8
then
7
9
echo " Script for running the CPP linter only on modified lines."
12
14
exit 1
13
15
fi
14
16
15
- if ! [[ -e scripts /cpplint.py ]]
17
+ if ! [[ -e $script_folder /cpplint.py ]]
16
18
then
17
- echo " Lint script could not be found in the scripts directory"
18
- echo " Ensure cpplint.py is inside the scripts directory then run again"
19
+ echo " Lint script could not be found in the $script_folder directory"
20
+ echo " Ensure cpplint.py is inside the $script_folder directory then run again"
19
21
exit 1
20
22
fi
21
23
@@ -81,7 +83,7 @@ for file in $diff_files; do
81
83
# Run the linting script and filter by the filter we've build
82
84
# of all the modified lines
83
85
# The errors from the linter go to STDERR so must be redirected to STDOUT
84
- result=` python scripts /cpplint.py $file 2>&1 | { grep -E " $lint_grep_filter " || true ; }`
86
+ result=` python $script_folder /cpplint.py $file 2>&1 | { grep -E " $lint_grep_filter " || true ; }`
85
87
86
88
# Providing some errors were relevant we print them out
87
89
if [ " $result " ]
You can’t perform that action at this time.
0 commit comments