Install and configure eslint and eslint-config-edx (alongside JSHint for now)
This commit is contained in:
@@ -12,7 +12,8 @@ set -e
|
||||
|
||||
# Violations thresholds for failing the build
|
||||
export PYLINT_THRESHOLD=4175
|
||||
export JSHINT_THRESHOLD=7550
|
||||
export JSHINT_THRESHOLD=7550 # @TODO Remove, deprecated in favor of ESLint
|
||||
export ESLINT_THRESHOLD=49019
|
||||
|
||||
SAFELINT_THRESHOLDS=`cat scripts/safelint_thresholds.json`
|
||||
export SAFELINT_THRESHOLDS=${SAFELINT_THRESHOLDS//[[:space:]]/}
|
||||
|
||||
@@ -60,10 +60,15 @@ else
|
||||
paver run_pylint -l $PYLINT_THRESHOLD | tee pylint.log || EXIT=1
|
||||
|
||||
mkdir -p reports
|
||||
echo "Finding jshint violations and storing report..."
|
||||
PATH=$PATH:node_modules/.bin
|
||||
|
||||
# @TODO: Remove, deprecated in favor of ESLint
|
||||
echo "Finding JSHint violations and storing report..."
|
||||
paver run_jshint -l $JSHINT_THRESHOLD > jshint.log || { cat jshint.log; EXIT=1; }
|
||||
|
||||
echo "Finding ESLint violations and storing report..."
|
||||
paver run_eslint -l $ESLINT_THRESHOLD > eslint.log || { cat eslint.log; EXIT=1; }
|
||||
|
||||
# Run quality task. Pass in the 'fail-under' percentage to diff-quality
|
||||
paver run_quality -p 100 || EXIT=1
|
||||
|
||||
|
||||
@@ -80,8 +80,14 @@ case "$TEST_SUITE" in
|
||||
paver run_pylint -l $PYLINT_THRESHOLD > pylint.log || { cat pylint.log; EXIT=1; }
|
||||
|
||||
mkdir -p reports
|
||||
echo "Finding jshint violations and storing report..."
|
||||
|
||||
# @TODO: Remove, deprecated in favor of ESLint
|
||||
echo "Finding JSHint violations and storing report..."
|
||||
paver run_jshint -l $JSHINT_THRESHOLD > jshint.log || { cat jshint.log; EXIT=1; }
|
||||
|
||||
echo "Finding ESLint violations and storing report..."
|
||||
paver run_eslint -l $ESLINT_THRESHOLD > eslint.log || { cat eslint.log; EXIT=1; }
|
||||
|
||||
echo "Running code complexity report (python)."
|
||||
paver run_complexity > reports/code_complexity.log || echo "Unable to calculate code complexity. Ignoring error."
|
||||
echo "Running safe template linter report."
|
||||
|
||||
@@ -543,7 +543,7 @@ class SummaryResults(object):
|
||||
print("{}: {}{} violations".format(rule_id, padding, self.totals_by_rule[rule_id]), file=out)
|
||||
print("", file=out)
|
||||
|
||||
# matches output of jshint for simplicity
|
||||
# matches output of eslint for simplicity
|
||||
print("", file=out)
|
||||
print("{} violations total".format(self.total_violations), file=out)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user