<commit_before>#!/usr/bin/env ruby

puts "Checking to see if you're in CONTRIBUTORS.md..."
if ENV['TRAVIS']
  if ENV['TRAVIS_PULL_REQUEST']
    require 'httparty'
    repo = ENV['TRAVIS_REPO_SLUG']
    pr = ENV['TRAVIS_PULL_REQUEST']
    url = "https://api.github.com/repos/#{repo}/pulls/#{pr}"
    response = HTTParty.get(url).parsed_response
    author = response['user']['login'] if response && response['user']

    # Could not determine author
    exit unless author
  else
    # We're in a Travis branch build; nothing to check
    exit
  end
else
  author = `git config github.user`.chomp
  if $CHILD_STATUS.exitstatus.positive?
    abort %(
Couldn't determine your GitHub username, and not in a Travis PR build
Please set it using

    git config --add github.user [username]
)
  end
end

unless system('grep', '-i', author, 'CONTRIBUTORS.md')
  abort %(
Thanks for your contribution, #{author}!
Please add your name and GitHub handle to the file CONTRIBUTORS.md,
commit it, and update your PR.<commit_msg>Auto corrected by following EmptyLine<commit_after>#!/usr/bin/env ruby

puts "Checking to see if you're in CONTRIBUTORS.md..."
if ENV['TRAVIS']
  if ENV['TRAVIS_PULL_REQUEST']
    require 'httparty'
    repo = ENV['TRAVIS_REPO_SLUG']
    pr = ENV['TRAVIS_PULL_REQUEST']
    url = "https://api.github.com/repos/#{repo}/pulls/#{pr}"
    response = HTTParty.get(url).parsed_response
    author = response['user']['login'] if response && response['user']

    # Could not determine author
    exit unless author
  else
    # We're in a Travis branch build; nothing to check
    exit
  end
else
  author = `git config github.user`.chomp
  if $CHILD_STATUS.exitstatus.positive?
    abort %(
Couldn't determine your GitHub username, and not in a Travis PR build
Please set it using
    git config --add github.user [username]
)
  end
end

unless system('grep', '-i', author, 'CONTRIBUTORS.md')
  abort %(
Thanks for your contribution, #{author}!
Please add your name and GitHub handle to the file CONTRIBUTORS.md,
commit it, and update your PR.
{'fraction_non_alphanumeric': 0.11701608971233544, 'fraction_numerical': 0.0, 'mean_word_length': 3.794392523364486, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1340840', 'n_tokens_mistral': 689, 'n_tokens_neox': 652, 'n_words': 217}