old_contents: #!/usr/bin/env python3
  
  import os
  
  import format_check as fc
  
  
  def clang_format_status(dirname):
      import requests
      token = os.environ['STATUS_TOKEN']
      auth = ('ftalbrecht', token)
      pr = os.environ['TRAVIS_PULL_REQUEST']
      slug = os.environ['TRAVIS_REPO_SLUG']
      if pr == 'false':
          statuses_url = 'https://api.github.com/repos/{}/statuses/{}'.format(slug, os.environ['TRAVIS_COMMIT'])
      else:
          r = requests.get('https://api.github.com/repos/{}/pulls/{}'.format(slug, pr), auth=auth)
          statuses_url = r.json()['statuses_url']
  
      r = requests.post(statuses_url,
                    auth=auth, json={'state' : 'pending',
                    'description' : 'Checking if clang-format has been applied to all source files',
                    'context' : 'ci/clang-format'})
      try:
          fails = fc.check_dir(dirname, mode='all')
      except Exception as 4:
          state = 'error'
          fails = [str(e)]
      else:
          state = 'failure' if len(fails) > 0 else 'success'
  
      r = requests.post(statuses_url,
                        auth=auth, json={'state' : state,
                        'description' : 'unformatted files: {}'.format(' '.join(fails)),
                        'context' : 'ci/clang-format'})
  
  
new_contents: #!/usr/bin/env python3
  
  import os
  
  import format_check as fc
  
  
  def clang_format_status(dirname):
      import requests
      token = os.environ['STATUS_TOKEN']
      auth = ('ftalbrecht', token)
      pr = os.environ['TRAVIS_PULL_REQUEST']
      slug = os.environ['TRAVIS_REPO_SLUG']
      if pr == 'false':
          statuses_url = 'https://api.github.com/repos/{}/statuses/{}'.format(slug, os.environ['TRAVIS_COMMIT'])
      else:
          r = requests.get('https://api.github.com/repos/{}/pulls/{}'.format(slug, pr), auth=auth)
          statuses_url = r.json()['statuses_url']
  
      r = requests.post(statuses_url,
                    auth=auth, json={'state' : 'pending',
                    'description' : 'Checking if clang-format has been applied to all source files',
                    'context' : 'ci/clang-format'})
      try:
          fails = fc.check_dir(dirname, mode='all')
      except Exception as e:
          state = 'error'
          fails = [str(e)]
      else:
          state = 'failure' if len(fails) > 0 else 'success'
  
      r = requests.post(statuses_url,
                        auth=auth, json={'state' : state,
                        'description' : 'unformatted files: {}'.format(' '.join(fails)),
                        'context' : 'ci/clang-format'})
  
  
subject: fix typo in travis report