<commit_before>###
# Please keep /.mergify.yml synced!
version: 2

jruby_env: &jruby_env
  # By default we have 2 CPUs and 4GB ram available
  # https://circleci.com/docs/2.0/configuration-reference/#resource_class
  JRUBY_OPTS: "--debug -J-Xmn1024m -J-Xms2048m -J-Xmx2048m"

common_env: &common_env
  # CircleCI container has two cores, but Ruby can see 32 cores. So we
  # configure test-queue.
  # See https://github.com/tmm1/test-queue#environment-variables
  TEST_QUEUE_WORKERS: 2

spec_steps: &spec_steps
  - checkout
  - attach_workspace:
      at: ~/project/tmp
  - run: bundle install
  - run:
      name: Run specs
      command: |
        ./tmp/cc-test-reporter before-build
        COVERAGE=true bundle exec rake spec
        ./tmp/cc-test-reporter format-coverage --output tmp/codeclimate.$CIRCLE_JOB.json
  - persist_to_workspace:
      root: tmp
      paths:
        - codeclimate.*.json

ascii_spec_steps: &ascii_spec_steps
  - checkout
  - run: bundle install
  - run: bundle exec rake ascii_spec

rubocop_steps: &rubocop_steps
  - checkout
  - run: bundle install
  - run: bundle exec rake internal_investigation
  - run:
      name: Check requiring libraries successfully
      # See https://github.com/rubocop-hq/rubocop/pull/4523#issuecomment-309136113
      command: |
        ruby -I lib -r bundler/setup -r rubocop -e 'exit 0'

jobs:

  # Ruby 2.4
  ruby-2.4-spec:
    docker:
      - image: circleci/ruby:2.4
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.4-ascii_spec:
    docker:
      - image: circleci/ruby:2.4
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.4-rubocop:
    docker:
      - image: circleci/ruby:2.4
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # Ruby 2.5
  ruby-2.5-spec:
    docker:
      - image: circleci/ruby:2.5
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.5-ascii_spec:
    docker:
      - image: circleci/ruby:2.5
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.5-rubocop:
    docker:
      - image: circleci/ruby:2.5
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # Ruby 2.6
  ruby-2.6-spec:
    docker:
      - image: circleci/ruby:2.6
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.6-ascii_spec:
    docker:
      - image: circleci/ruby:2.6
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.6-rubocop:
    docker:
      - image: circleci/ruby:2.6
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # Ruby 2.7
  ruby-2.7-spec:
    docker:
      - image: circleci/ruby:2.7
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.7-ascii_spec:
    docker:
      - image: circleci/ruby:2.7
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.7-rubocop:
    docker:
      - image: circleci/ruby:2.7
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # ruby-head (nightly snapshot build)
  ruby-head-spec:
    docker:
      - image: rubocophq/circleci-ruby-snapshot:latest
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-head-ascii_spec:
    docker:
      - image: rubocophq/circleci-ruby-snapshot:latest
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-head-rubocop:
    docker:
      - image: rubocophq/circleci-ruby-snapshot:latest
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # JRuby 9.2
  jruby-9.2-spec:
    docker:
      - image: circleci/jruby:9.2
    environment:
      <<: *common_env
      <<: *jruby_env
    steps:
      *spec_steps
  jruby-9.2-ascii_spec:
    docker:
      - image: circleci/jruby:9.2
    environment:
      <<: *common_env
      <<: *jruby_env
    steps:
      *ascii_spec_steps
  jruby-9.2-rubocop:
    docker:
      - image: circleci/jruby:9.2
    environment:
      <<: *common_env
      <<: *jruby_env
    steps:
      *rubocop_steps

  # Job for downloading the Code Climate test reporter
  cc-setup:
    docker:
      - image: circleci/ruby
    environment:
      <<: *common_env
    steps:
      - run:
          name: Download Code Climate test-reporter
          command: |
            mkdir -p tmp/
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./tmp/cc-test-reporter
            chmod +x ./tmp/cc-test-reporter
      - persist_to_workspace:
          root: tmp
          paths:
            - cc-test-reporter

  # Job for merging code coverage results and sending them to Code Climate
  cc-upload-coverage:
    docker:
      - image: circleci/ruby
        environment:
          CC_TEST_REPORTER_ID: a11b66bfbb1acdf220d5cb317b2e945a986fd85adebe29a76d411ad6d74ec31f
    environment:
      <<: *common_env
    steps:
      - attach_workspace:
          at: ~/project/tmp<commit_msg>Specify Code Climate Test Reporter 0.7.0 as a workaround<commit_after>###
# Please keep /.mergify.yml synced!
version: 2

jruby_env: &jruby_env
  # By default we have 2 CPUs and 4GB ram available
  # https://circleci.com/docs/2.0/configuration-reference/#resource_class
  JRUBY_OPTS: "--debug -J-Xmn1024m -J-Xms2048m -J-Xmx2048m"

common_env: &common_env
  # CircleCI container has two cores, but Ruby can see 32 cores. So we
  # configure test-queue.
  # See https://github.com/tmm1/test-queue#environment-variables
  TEST_QUEUE_WORKERS: 2

spec_steps: &spec_steps
  - checkout
  - attach_workspace:
      at: ~/project/tmp
  - run: bundle install
  - run:
      name: Run specs
      command: |
        ./tmp/cc-test-reporter before-build
        COVERAGE=true bundle exec rake spec
        ./tmp/cc-test-reporter format-coverage --output tmp/codeclimate.$CIRCLE_JOB.json
  - persist_to_workspace:
      root: tmp
      paths:
        - codeclimate.*.json

ascii_spec_steps: &ascii_spec_steps
  - checkout
  - run: bundle install
  - run: bundle exec rake ascii_spec

rubocop_steps: &rubocop_steps
  - checkout
  - run: bundle install
  - run: bundle exec rake internal_investigation
  - run:
      name: Check requiring libraries successfully
      # See https://github.com/rubocop-hq/rubocop/pull/4523#issuecomment-309136113
      command: |
        ruby -I lib -r bundler/setup -r rubocop -e 'exit 0'

jobs:

  # Ruby 2.4
  ruby-2.4-spec:
    docker:
      - image: circleci/ruby:2.4
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.4-ascii_spec:
    docker:
      - image: circleci/ruby:2.4
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.4-rubocop:
    docker:
      - image: circleci/ruby:2.4
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # Ruby 2.5
  ruby-2.5-spec:
    docker:
      - image: circleci/ruby:2.5
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.5-ascii_spec:
    docker:
      - image: circleci/ruby:2.5
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.5-rubocop:
    docker:
      - image: circleci/ruby:2.5
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # Ruby 2.6
  ruby-2.6-spec:
    docker:
      - image: circleci/ruby:2.6
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.6-ascii_spec:
    docker:
      - image: circleci/ruby:2.6
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.6-rubocop:
    docker:
      - image: circleci/ruby:2.6
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # Ruby 2.7
  ruby-2.7-spec:
    docker:
      - image: circleci/ruby:2.7
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-2.7-ascii_spec:
    docker:
      - image: circleci/ruby:2.7
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-2.7-rubocop:
    docker:
      - image: circleci/ruby:2.7
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # ruby-head (nightly snapshot build)
  ruby-head-spec:
    docker:
      - image: rubocophq/circleci-ruby-snapshot:latest
    environment:
      <<: *common_env
    steps:
      *spec_steps
  ruby-head-ascii_spec:
    docker:
      - image: rubocophq/circleci-ruby-snapshot:latest
    environment:
      <<: *common_env
    steps:
      *ascii_spec_steps
  ruby-head-rubocop:
    docker:
      - image: rubocophq/circleci-ruby-snapshot:latest
    environment:
      <<: *common_env
    steps:
      *rubocop_steps

  # JRuby 9.2
  jruby-9.2-spec:
    docker:
      - image: circleci/jruby:9.2
    environment:
      <<: *common_env
      <<: *jruby_env
    steps:
      *spec_steps
  jruby-9.2-ascii_spec:
    docker:
      - image: circleci/jruby:9.2
    environment:
      <<: *common_env
      <<: *jruby_env
    steps:
      *ascii_spec_steps
  jruby-9.2-rubocop:
    docker:
      - image: circleci/jruby:9.2
    environment:
      <<: *common_env
      <<: *jruby_env
    steps:
      *rubocop_steps

  # Job for downloading the Code Climate test reporter
  cc-setup:
    docker:
      - image: circleci/ruby
    environment:
      <<: *common_env
    steps:
      - run:
          name: Download Code Climate test-reporter
          # Specify Code Climate Test Reporter 0.7.0 as a workaround to prevent
          # `cannot execute binary file: Exec format error`.
          # See: https://github.com/codeclimate/test-reporter/issues/449
          command: |
            mkdir -p tmp/
            curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-0.7.0-linux-amd64 > ./tmp/cc-test-reporter
            chmod +x ./tmp/cc-test-reporter
      - persist_to_workspace:
          root: tmp
          paths:
            - cc-test-reporter

  # Job for merging code coverage results and sending them to Code Climate
  cc-upload-coverage:
    docker:
      - image: circleci/ruby
        environment:
          CC_TEST_REPORTER_ID: a11b66bfbb1acdf220d5cb317b2e945a986fd85adebe29a76d411ad6d74ec31f
    environment:
      <<: *common_env
    steps:
      - attach_workspace:
          at: ~/project/tmp
{'fraction_non_alphanumeric': 0.10946397015511486, 'fraction_numerical': 0.028666797565285687, 'mean_word_length': 2.133497385419871, 'pattern_counts': {'":': 0, '<': 95, '<?xml version=': 0, '>': 5, 'https://': 9, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1262869', 'n_tokens_mistral': 3939, 'n_tokens_neox': 3630, 'n_words': 710}