diff --git a/.drone.yml b/.drone.yml index 5969c9b4f..79ab8b801 100644 --- a/.drone.yml +++ b/.drone.yml @@ -150,6 +150,13 @@ pipeline: when: matrix: TESTS: integration + eslint: + image: nextcloudci/eslint:eslint-1 + commands: + - ./run-eslint.sh + when: + matrix: + TESTS: eslint jsbuild: image: mhart/alpine-node:6.8.0 commands: @@ -169,6 +176,7 @@ matrix: - TESTS: php5.6 - TESTS: php7.0 - TESTS: php7.1 + - TESTS: eslint - TESTS: jsbuild - TESTS: integration diff --git a/Makefile b/Makefile index c45aec1bb..0af7aa611 100644 --- a/Makefile +++ b/Makefile @@ -62,6 +62,7 @@ appstore: clean-build build --exclude="../$(app_name)/protractor\.*" \ --exclude="../$(app_name)/.*" \ --exclude="../$(app_name)/*.lock" \ + --exclude="../$(app_name)/run-eslint.sh" \ --exclude="../$(app_name)/js/.*" \ --exclude="../$(app_name)/vendor" \ --exclude-vcs \ diff --git a/run-eslint.sh b/run-eslint.sh new file mode 100644 index 000000000..50548f107 --- /dev/null +++ b/run-eslint.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e + +ESLINT=$(which eslint || true) +if [ -z "$ESLINT" ]; then + echo "Can't find command \"eslint\" in $PATH" + exit 1 +fi + +echo Checking scripts with $ESLINT ... +find -name "*.js" -print0 | xargs -0 $ESLINT