<commit_before>version: 2.0

# heavily inspired by https://raw.githubusercontent.com/pinax/pinax-wiki/6bd2a99ab6f702e300d708532a6d1d9aa638b9f8/.circleci/config.yml

common: &common
  working_directory: ~/repo
  steps:
    - checkout
    - restore_cache:
        keys:
          - cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
    - run:
        name: install dependencies
        command: pip install --user tox
    - run:
        name: run tox
        command: ~/.local/bin/tox
    - save_cache:
        paths:
          - .tox
          - ~/.cache/pip
          - ~/.local
          - ./eggs
        key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

jobs:
  lint:
    <<: *common
    docker:
      - image: circleci/python:3.5
        environment:
          TOXENV: lint
  py35:
    <<: *common
    docker:
      - image: circleci/python:3.5
        environment:
          TOXENV: py35
  py36:
    <<: *common
    docker:
      - image: circleci/python:3.6
        environment:
          TOXENV: py36
  pypy3:
    <<: *common
    docker:
      - image: pypy
        environment:
          TOXENV: pypy3
workflows:
  version: 2
  test:
    jobs:
      - lint
      - py35
      - py36
      - pypy3<commit_msg>Make Circle CI test against merge into PR base<commit_after>version: 2.0

# heavily inspired by https://raw.githubusercontent.com/pinax/pinax-wiki/6bd2a99ab6f702e300d708532a6d1d9aa638b9f8/.circleci/config.yml

common: &common
  working_directory: ~/repo
  steps:
    - checkout
    - run:
        name: merge pull request base
        command: |
          if [[ -n "${CIRCLE_PR_NUMBER}" ]]; then
            PR_INFO_URL=https://api.github.com/repos/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/pulls/$CIRCLE_PR_NUMBER

            PR_BASE_BRANCH=$(curl -L "$PR_INFO_URL" | python -c 'import json, sys; obj = json.load(sys.stdin); sys.stdout.write(obj["base"]["ref"])')
            git fetch origin +"$PR_BASE_BRANCH":circleci/pr-base

            # We need these config values or git complains when creating the
            # merge commit
            git config --global user.name "Circle CI"
            git config --global user.email "<EMAIL>"

            git merge --no-edit circleci/pr-base
          fi
    - restore_cache:
        keys:
          - cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}
    - run:
        name: install dependencies
        command: pip install --user tox
    - run:
        name: run tox
        command: ~/.local/bin/tox
    - save_cache:
        paths:
          - .tox
          - ~/.cache/pip
          - ~/.local
          - ./eggs
        key: cache-{{ .Environment.CIRCLE_JOB }}-{{ checksum "setup.py" }}-{{ checksum "tox.ini" }}

jobs:
  lint:
    <<: *common
    docker:
      - image: circleci/python:3.5
        environment:
          TOXENV: lint
  py35:
    <<: *common
    docker:
      - image: circleci/python:3.5
        environment:
          TOXENV: py35
  py36:
    <<: *common
    docker:
      - image: circleci/python:3.6
        environment:
          TOXENV: py36
  pypy3:
    <<: *common
    docker:
      - image: pypy
        environment:
          TOXENV: pypy3

workflows:
  version: 2
  test:
    jobs:
      - lint
      - py35
      - py36
      - pypy3
{'fraction_non_alphanumeric': 0.1255952380952381, 'fraction_numerical': 0.029166666666666667, 'mean_word_length': 1.7708161582852433, 'pattern_counts': {'":': 1, '<': 20, '<?xml version=': 0, '>': 4, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3700270', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1152, 'n_words': 243}