diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9bd1f9d9..8f6b13ab 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,7 +24,7 @@ eslint: image: registry.gitlab.gnome.org/gnome/gnome-shell/extension-ci:v1 stage: source_check script: - - sh lint/generate-report.sh -o $LINT_LOG || { cat $LINT_LOG; false; } + - eslint -o $LINT_LOG --no-color || { cat $LINT_LOG; false; } <<: *only_default artifacts: paths: diff --git a/lint/eslintrc-legacy.json b/lint/eslintrc-legacy.json deleted file mode 100644 index aca79adf..00000000 --- a/lint/eslintrc-legacy.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "rules": { - "indent": [ - "error", - 4, - { - "ignoredNodes": [ - "CallExpression > ArrowFunctionExpression", - "CallExpression[callee.object.name=GObject][callee.property.name=registerClass] > ClassExpression:first-child" - ], - "CallExpression": { "arguments": "first" }, - "MemberExpression": "off" - } - ] - } -} diff --git a/lint/generate-report.sh b/lint/generate-report.sh deleted file mode 100644 index 1d34401e..00000000 --- a/lint/generate-report.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/sh -SEP=`printf '\t'` -OUTPUT=/dev/stderr -CWD=`pwd` -SRCDIR=`dirname $0` - -run_lint() { - eslint -f unix "$@" . -} - -parse_opts() { - tmp=`getopt -l output: o: "$@"` - [ $? -ne 0 ] && exit 1 - - eval set -- $tmp - while true - do - case $1 in - --output|-o) - OUTPUT=`realpath $2`; shift 2; continue ;; - --) - shift; break ;; - esac - done -} - -# delete lines that don't start with '/', -# replace the first space with tab, sort -process_for_join() { - sed -E "/\//!d; s|(\S+)\s|\1$SEP|" | sort -k 1b,1 -} - -# re-replace tab with space -process_post_join() { - sed -E "s|$SEP| |" -} - -create_report() { - tmp1=`mktemp --tmpdir lint-XXXX` - run_lint | process_for_join > $tmp1 - - tmp2=`mktemp --tmpdir lint-XXXX` - run_lint -c lint/eslintrc-legacy.json | process_for_join > $tmp2 - - join -t"$SEP" -o '0,1.2' $tmp1 $tmp2 | process_post_join - rm $tmp1 $tmp2 -} - - -parse_opts "$@" - -cd $SRCDIR/.. - -create_report | tee $OUTPUT | grep -q . -rv=$(( $? == 0 )) - -cd $CWD - -[ $rv -eq 0 -a -f $OUTPUT ] && rm $OUTPUT - -exit $rv