From f8f755f31ecbb3e274889734fc74dec88db56107 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Sat, 11 Nov 2017 12:12:32 +0100 Subject: [PATCH] Add eslint drone test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .drone.yml | 8 ++++++++ Makefile | 1 + run-eslint.sh | 11 +++++++++++ 3 files changed, 20 insertions(+) create mode 100644 run-eslint.sh 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