prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  Make JSON linting more verbose ?
  Currently we simply check :
  1. json is valid
  2. json contains the keys we want
  3. those keys are not empty
  
  the problem is with step 1, it's not very helpful if people have no idea what the JSON spec is.
  
  One fix is :
  1. add a link to jsonlint.com or such a service in the print of the error so that people can check themselves.
  2. add something like http://deron.meranda.us/python/demjson/ with proper package caching on travis side, but it will make for slower builds still probably
  
  </issue>
  <code>
  [start of .travis.py]
  1 import json
  2 import os
  3 import re
  4 import subprocess
  5 
  6 # Get a diff between master and current.
  7 try:
  8     commit_range = os.environ["TRAVIS_COMMIT_RANGE"]
  9     changed_files = subprocess.check_output(["git", "diff", "--name-only", commit_range])
  10 except KeyError:
  11     print("🔥 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.")
  12     exit(1)
  13 
  14 # Filter JSON files only.
  15 changed_files_json = []
  16 if changed_files:
  17     changed_files = changed_files.decode()
  18     for changed_file in changed_files.split('\n'):
  19         if re.search(r"\.json$", changed_file):
  20             changed_files_json.append(changed_file)
  21 
  22  
  23 # Iterate over list of changed JSON files.
  24 for changed_file_json in changed_files_json:
  25     print(f"Checking file {changed_file_json}...")
  26     there_was_an_error = False
  27 
  28     if not os.path.basename(changed_file_json)[0].isupper():
  29         there_was_an_error = True
  30         print("🔥 File name not capitalized.")
  31 
  32     try:
  33         with open(changed_file_json) as data_file:
  34             file_content = json.loads(data_file.read())
  35     except json.decoder.JSONDecodeError:
  36         there_was_an_error = True
  37         print("🔥 JSON could not be parsed.")
  38 
  39     if 'word' not in file_content:
  40         there_was_an_error = True
  41         print("🔥 Key 'word' not found.")
  42 
  43     if not file_content["word"]:
  44         there_was_an_error = True
  45         print("🔥 Value for 'word' appears to be empty.")
  46 
  47     if 'definitions' not in file_content:
  48         there_was_an_error = True
  49         print("🔥 Key 'definitions' not found.")
  50 
  51     if not file_content["definitions"]:
  52         there_was_an_error = True
  53         print("🔥 Value for 'definitions' appears to be empty.")
  54 
  55     if 'parts-of-speech' not in file_content:
  56         there_was_an_error = True
  57         print("🔥 Key 'parts-of-speech' not found.")
  58 
  59     if not file_content["parts-of-speech"]:
  60         there_was_an_error = True
  61         print("🔥 Value for 'parts-of-speech' appears to be empty.")
  62 
  63     if there_was_an_error:
  64         exit(1)
  65
  [end of .travis.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/.travis.py b/.travis.py
  --- a/.travis.py
  +++ b/.travis.py
  @@ -34,7 +34,7 @@
               file_content = json.loads(data_file.read())
       except json.decoder.JSONDecodeError:
           there_was_an_error = True
  -        print("🔥 JSON could not be parsed.")
  +        print(f"🔥 JSON could not be parsed. Follow this link to know more : https://jsonlint.com/?json={data_file.read()}")
   
       if 'word' not in file_content:
           there_was_an_error = True
  
verification_info: {"golden_diff": "diff --git a/.travis.py b/.travis.py\n--- a/.travis.py\n+++ b/.travis.py\n@@ -34,7 +34,7 @@\n             file_content = json.loads(data_file.read())\n     except json.decoder.JSONDecodeError:\n         there_was_an_error = True\n-        print(\"\ud83d\udd25 JSON could not be parsed.\")\n+        print(f\"\ud83d\udd25 JSON could not be parsed. Follow this link to know more : https://jsonlint.com/?json={data_file.read()}\")\n \n     if 'word' not in file_content:\n         there_was_an_error = True\n", "issue": "Make JSON linting more verbose ?\nCurrently we simply check :\r\n1. json is valid\r\n2. json contains the keys we want\r\n3. those keys are not empty\r\n\r\nthe problem is with step 1, it's not very helpful if people have no idea what the JSON spec is.\r\n\r\nOne fix is :\r\n1. add a link to jsonlint.com or such a service in the print of the error so that people can check themselves.\r\n2. add something like http://deron.meranda.us/python/demjson/ with proper package caching on travis side, but it will make for slower builds still probably\n", "before_files": [{"content": "import json\nimport os\nimport re\nimport subprocess\n\n# Get a diff between master and current.\ntry:\n    commit_range = os.environ[\"TRAVIS_COMMIT_RANGE\"]\n    changed_files = subprocess.check_output([\"git\", \"diff\", \"--name-only\", commit_range])\nexcept KeyError:\n    print(\"\ud83d\udd25 This should be run on Travis. Otherwise make sure TRAVIS_BRANCH is set.\")\n    exit(1)\n\n# Filter JSON files only.\nchanged_files_json = []\nif changed_files:\n    changed_files = changed_files.decode()\n    for changed_file in changed_files.split('\\n'):\n        if re.search(r\"\\.json$\", changed_file):\n            changed_files_json.append(changed_file)\n\n \n# Iterate over list of changed JSON files.\nfor changed_file_json in changed_files_json:\n    print(f\"Checking file {changed_file_json}...\")\n    there_was_an_error = False\n\n    if not os.path.basename(changed_file_json)[0].isupper():\n        there_was_an_error = True\n        print(\"\ud83d\udd25 File name not capitalized.\")\n\n    try:\n        with open(changed_file_json) as data_file:\n            file_content = json.loads(data_file.read())\n    except json.decoder.JSONDecodeError:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 JSON could not be parsed.\")\n\n    if 'word' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'word' not found.\")\n\n    if not file_content[\"word\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'word' appears to be empty.\")\n\n    if 'definitions' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'definitions' not found.\")\n\n    if not file_content[\"definitions\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'definitions' appears to be empty.\")\n\n    if 'parts-of-speech' not in file_content:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Key 'parts-of-speech' not found.\")\n\n    if not file_content[\"parts-of-speech\"]:\n        there_was_an_error = True\n        print(\"\ud83d\udd25 Value for 'parts-of-speech' appears to be empty.\")\n\n    if there_was_an_error:\n        exit(1)\n", "path": ".travis.py"}]}