Skip to content

Commit

Permalink
mozilla#286: Add NSP to lint command in CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Kelly committed Feb 15, 2017
1 parent 5712f7b commit 70c4acc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lints/bin/default_command
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
#!/usr/bin/env bash

num_errors=0

cd /app/code
therapist run --use-tracked-files
if [[ $? -ne 0 ]]; then
num_errors=$((num_errors + 1))
fi

for directory in *; do
if [[ -f $directory/package.json ]]; then
echo "Checking $directory for known NPM security issues..."
pushd $directory
nsp check
if [[ $? -ne 0 ]]; then
num_errors=$((num_errors + 1))
fi
popd
fi
done

exit $num_errors
1 change: 1 addition & 0 deletions lints/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"moment": "2.14.1",
"node-sass": "3.9.3",
"node-uuid": "1.4.7",
"nsp": "^2.6.2",
"react": "15.3.1",
"react-addons-css-transition-group": "15.3.1",
"react-breadcrumbs": "1.3.16",
Expand Down

0 comments on commit 70c4acc

Please sign in to comment.