<commit_before>
name: CI Checks & Build

on: [ push, pull_request ]

jobs:
  flake8:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 2.7
      uses: actions/setup-python@v2
      with:
        python-version: 2.7.18
    - name: Install dependencies
      run: |
        python -m pip install --upgrade 'pip==20.3.1'
        python -m pip install flake8
        python -m pip install -r requirements/dev.txt
    - name: Lint with flake8
      run: flake8 moderator --count --show-source --statistics

  eslint-stylelint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: 12.18.3
      - run: npm install -g eslint stylelint
      - run: eslint 'moderator/moderate/static/js/*.js'
      - run: stylelint 'moderator/moderate/static/css/*.css'

  prepare:
    needs:
      - flake8
      - eslint-stylelint
    runs-on: ubuntu-latest
    outputs:
      FULL_IMAGE_TAG: ${{ steps.tag.outputs.tag }}
    steps:
      - name: Set Tag
        id: tag
        run: |
          export CI_COMMIT_SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-8)
          echo $CI_COMMIT_SHORT_SHA;
          echo ${GITHUB_REF##*/};
          echo $version_pattern;
          if [[ ${GITHUB_REF} =~ $version_pattern ]]; then<commit_msg>remove eslint step per dev instructions<commit_after>
name: CI Checks & Build

on: [ push, pull_request ]

jobs:
  flake8:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Python 2.7
      uses: actions/setup-python@v2
      with:
        python-version: 2.7.18
    - name: Install dependencies
      run: |
        python -m pip install --upgrade 'pip==20.3.1'
        python -m pip install flake8
        python -m pip install -r requirements/dev.txt
    - name: Lint with flake8
      run: flake8 moderator --count --show-source --statistics

  prepare:
    needs:
      - flake8
    runs-on: ubuntu-latest
    outputs:
      FULL_IMAGE_TAG: ${{ steps.tag.outputs.tag }}
    steps:
      - name: Set Tag
        id: tag
        run: |
          export CI_COMMIT_SHORT_SHA=$(echo $GITHUB_SHA | cut -c1-8)
          echo $CI_COMMIT_SHORT_SHA;
          echo ${GITHUB_REF##*/};
          echo $version_pattern;
          if [[ ${GITHUB_REF} =~ $version_pattern ]]; then
{'fraction_non_alphanumeric': 0.11427357689039933, 'fraction_numerical': 0.019116397621070518, 'mean_word_length': 1.9961832061068703, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '2850714', 'n_tokens_mistral': 834, 'n_tokens_neox': 789, 'n_words': 200}