Skip to content

Commit 46315eb

Browse files
committed
Update hook to lint CLIs
1 parent c65a9e4 commit 46315eb

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tools/git/hooks/pre-commit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ run_lint() {
109109
fi
110110
fi
111111

112+
# Lint JavaScript command-line interfaces...
113+
files=$(echo "${changed_files}" | grep '\/bin\/cli$' | tr '\n' ' ')
114+
if [[ -n "${files}" ]]; then
115+
make FILES="${files}" lint-javascript-files > /dev/null >&2
116+
if [[ "$?" -ne 0 ]]; then
117+
echo '' >&2
118+
echo 'JavaScript lint errors for command-line interface files.' >&2
119+
return 1
120+
fi
121+
fi
122+
112123
# Lint JavaScript examples files...
113124
files=$(echo "${changed_files}" | grep 'examples/.*\.js$' | tr '\n' ' ')
114125
if [[ -n "${files}" ]]; then

0 commit comments

Comments
 (0)