From 61c07368ff582025a411984c94f6a1b0432aa580 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 15 Jul 2020 13:56:30 -0400 Subject: [PATCH 1/3] Run Yarn lint script in CircleCI test step **Why**: CircleCI should report the results of linting as test output, as a substitute for CodeClimate, and to ensure that static analysis remains in place for quality code. --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index e729a7066b4..165796c4c34 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,6 +155,7 @@ jobs: bundle exec rake knapsack:rspec yarn test + yarn run lint bundle exec slim-lint app/views - run: name: Code Climate Test Coverage From 521063e1eab4d23d60690237dcca6f9d1c3b32fa Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 15 Jul 2020 13:57:10 -0400 Subject: [PATCH 2/3] Remove ESLint plugin from CodeClimate **Why**: CodeClimate does not appear to respect local ESLint configuration in all cases, causing many false negatives and false positives. --- .codeclimate.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.codeclimate.yml b/.codeclimate.yml index dfbba505586..c79776263ff 100644 --- a/.codeclimate.yml +++ b/.codeclimate.yml @@ -56,13 +56,6 @@ plugins: - 'app/forms/password_form.rb' - 'lib/user_flow_exporter.rb' - 'lib/rspec/formatters/user_flow_formatter.rb' - eslint: - enabled: true - channel: eslint-6 - config: - extensions: - - .js - - .jsx fixme: enabled: true exclude_patterns: From 664370a44b1aa567ef074e89bf434b91276a73f5 Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Wed, 15 Jul 2020 15:13:02 -0400 Subject: [PATCH 3/3] Create separate CircleCI job for lint tasks **Why**: Split out lint tasks for better discoverability, and quicker execution --- .circleci/config.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 165796c4c34..e7c84fbdbca 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -155,8 +155,6 @@ jobs: bundle exec rake knapsack:rspec yarn test - yarn run lint - bundle exec slim-lint app/views - run: name: Code Climate Test Coverage command: | @@ -172,6 +170,17 @@ jobs: command: | aws s3 sync "s3://login-gov-test-coverage/coverage/$CIRCLE_BUILD_NUM" coverage/ ./cc-test-reporter sum-coverage --output - --parts $CIRCLE_NODE_TOTAL coverage/codeclimate.*.json | ./cc-test-reporter upload-coverage --input - + lints: + working_directory: ~/identity-idp + executor: ruby_browsers + steps: + - checkout + - bundle-yarn-install + - run: + name: Run Lints + command: | + yarn run lint + bundle exec slim-lint app/views build-latest-container: working_directory: ~/identity-idp docker: @@ -272,6 +281,7 @@ workflows: release: jobs: - build + - lints - build-latest-dev-container: requires: - build