<commit_before>#!/bin/bash

set -eu

# check linux tests

FIRST_OUT="$(git status --porcelain)"
ruby scripts/generate_linux_tests.rb > /dev/null
SECOND_OUT="$(git status --porcelain)"
if [[ "$FIRST_OUT" != "$SECOND_OUT" ]]; then
  printf "\033[0;31mMissing linux test changes!\033[0m\n"
  git --no-pager diff
  exit 1
else
  printf "\033[0;32mLinux tests okay\033[0m\n"
fi<commit_msg>add license headers check to sanity script (#106)<commit_after>#!/bin/bash

set -eu

printf "=> Checking linux tests... "
FIRST_OUT="$(git status --porcelain)"
ruby scripts/generate_linux_tests.rb > /dev/null
SECOND_OUT="$(git status --porcelain)"
if [[ "$FIRST_OUT" != "$SECOND_OUT" ]]; then
  printf "\033[0;31mmissing changes!\033[0m\n"
  git --no-pager diff
  exit 1
else
  printf "\033[0;32mokay.\033[0m\n"
fi

printf "=> Checking license headers... "
NON_LICENSED_FILES="$(grep --include=\*.swift --exclude-dir=.build -rL "Licensed under Apache License v2.0" .)"
if [[ -n "$NON_LICENSED_FILES" ]]; then
  printf "\033[0;31mmissing headers!\033[0m\n"
  printf "$NON_LICENSED_FILES\n"
  exit 1
else
  printf "\033[0;32mokay.\033[0m\n"
fi
{'fraction_non_alphanumeric': 0.17422222222222222, 'fraction_numerical': 0.060444444444444446, 'mean_word_length': 4.261682242990654, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '719686', 'n_tokens_mistral': 489, 'n_tokens_neox': 435, 'n_words': 101}