<commit_before>name: JavaScript

on:
  push:
    branches:
    - "5.2"
    - "5.3"
    - "5.4"
    - master
  pull_request:

jobs:
  syntax:
    name: "Check Syntax"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
    - name: Set up node.js
      uses: actions/setup-node@v2
      with:
        node-version: "16"
    - uses: actions/checkout@v3
    - run: echo "::add-matcher::.github/javascript-syntax.json"
    - name: Remove files to be ignored
      run: |
        true
    - run: |
        ! find wcfsetup/ -type f -name '*.js' -exec node -c '{}' \; 2>&1 \
          |awk 'BEGIN {m=0} /(.js):[0-9]+$/ {m=1; printf "%s - ",$0} m==1 && /^SyntaxError/ { m=0; print }' \
          |sed "s@$(pwd)@.@" \
          |grep '^'
  dependency:
    name: "Check that npm dependencies are in sync"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
    - name: Set up node.js
      uses: actions/setup-node@v2
      with:
        node-version: "16"
    - uses: actions/checkout@v3
    - name: "Check 'focus-trap'"
      run: |<commit_msg>Fix dependency sync check in javascript.yml<commit_after>name: JavaScript

on:
  push:
    branches:
    - "5.2"
    - "5.3"
    - "5.4"
    - master
  pull_request:

jobs:
  syntax:
    name: "Check Syntax"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
    - name: Set up node.js
      uses: actions/setup-node@v2
      with:
        node-version: "16"
    - uses: actions/checkout@v3
    - run: echo "::add-matcher::.github/javascript-syntax.json"
    - name: Remove files to be ignored
      run: |
        true
    - run: |
        ! find wcfsetup/ -type f -name '*.js' -exec node -c '{}' \; 2>&1 \
          |awk 'BEGIN {m=0} /(.js):[0-9]+$/ {m=1; printf "%s - ",$0} m==1 && /^SyntaxError/ { m=0; print }' \
          |sed "s@$(pwd)@.@" \
          |grep '^'
  dependency:
    name: "Check that npm dependencies are in sync"
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
    steps:
    - uses: actions/checkout@v3
    - name: Set up node.js
      uses: actions/setup-node@v2
      with:
        node-version: "16"
    - run: npm install
    - name: "Check 'focus-trap'"
      run: |
{'fraction_non_alphanumeric': 0.1620767494356659, 'fraction_numerical': 0.02076749435665914, 'mean_word_length': 1.8337595907928388, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7127173', 'n_tokens_mistral': 851, 'n_tokens_neox': 828, 'n_words': 206}