<commit_before>name: Lint

on: [push, pull_request]

jobs:
  all-json-valid:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Lint Valid Json
      run: |
        find quirks/ -name '*.json' -print0 -maxdepth 1 | while IFS= read -r -d '' filename; do
          echo "Validating $(basename "$filename")"
          python -mjson.tool "$filename" > /dev/null
        done

  change-password-urls:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Lint Sort Order
      run: cat quirks/change-password-URLs.json | sed '1,1d' | sed '$d' | sort -c

  password-rules:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Lint Sort Order
      run: cat quirks/password-rules.json | grep "^    \"" | sort -c

  websites-shared-credentials:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.6
    - name: Lint Sort Order
      run: ruby .github/workflows/lint-scripts/websites-shared-credentials-sort-order.rb
    - name: Lint Duplicates
      run: ruby .github/workflows/lint-scripts/websites-shared-credentials-duplicates.rb

  validate-schemas:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - uses: actions/setup-node@v3
    - name: Install ajv-cli
      run: npm install -g ajv-cli
    - name: Validate JSONs against their schemas
      run: ./tools/validate-json-schemas.sh<commit_msg>Update lint.yml (#622)<commit_after>name: Lint

on: [push, pull_request]

jobs:
  all-json-valid:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Lint Valid Json
      run: |
        find quirks/ -name '*.json' -print0 -maxdepth 1 | while IFS= read -r -d '' filename; do
          echo "Validating $(basename "$filename")"
          python -mjson.tool "$filename" > /dev/null
        done

  change-password-urls:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Lint Sort Order
      run: cat quirks/change-password-URLs.json | sed '1,1d' | sed '$d' | sort -c

  password-rules:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Lint Sort Order
      run: cat quirks/password-rules.json | grep "^    \"" | sort -c

  websites-shared-credentials:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.6
    - name: Lint Sort Order
      run: ruby .github/workflows/lint-scripts/websites-shared-credentials-sort-order.rb
    - name: Lint Duplicates
      run: ruby .github/workflows/lint-scripts/websites-shared-credentials-duplicates.rb

  validate-schemas:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: actions/setup-node@v3
    - name: Install ajv-cli
      run: npm install -g ajv-cli
    - name: Validate JSONs against their schemas
      run: ./tools/validate-json-schemas.sh
{'fraction_non_alphanumeric': 0.12191103789126853, 'fraction_numerical': 0.009555189456342669, 'mean_word_length': 2.314410480349345, 'pattern_counts': {'":': 0, '<': 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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4089778', 'n_tokens_mistral': 1102, 'n_tokens_neox': 1048, 'n_words': 255}