prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  command to check lock file
  <!-- Checked checkbox should look like this: [x] -->
  - [X] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.
  
  ## Issue
  
  Would it be possible to add a `poetry check` command (oh, I see you'e used that already, maybe the command could be extended or have a `poetry lock --check`?) that will return zero if the current poetry.lock is both correct w.r.t. the pyproject.toml (ie: packages match) *and* that it matches the output of `poetry lock`.
  
  
  </issue>
  <code>
  [start of poetry/console/commands/lock.py]
  1 from cleo.helpers import option
  2 
  3 from .installer_command import InstallerCommand
  4 
  5 
  6 class LockCommand(InstallerCommand):
  7 
  8     name = "lock"
  9     description = "Locks the project dependencies."
  10 
  11     options = [
  12         option(
  13             "no-update", None, "Do not update locked versions, only refresh lock file."
  14         ),
  15     ]
  16 
  17     help = """
  18 The <info>lock</info> command reads the <comment>pyproject.toml</> file from the
  19 current directory, processes it, and locks the dependencies in the <comment>poetry.lock</>
  20 file.
  21 
  22 <info>poetry lock</info>
  23 """
  24 
  25     loggers = ["poetry.repositories.pypi_repository"]
  26 
  27     def handle(self) -> int:
  28         self._installer.use_executor(
  29             self.poetry.config.get("experimental.new-installer", False)
  30         )
  31 
  32         self._installer.lock(update=not self.option("no-update"))
  33 
  34         return self._installer.run()
  35
  [end of poetry/console/commands/lock.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/poetry/console/commands/lock.py b/poetry/console/commands/lock.py
  --- a/poetry/console/commands/lock.py
  +++ b/poetry/console/commands/lock.py
  @@ -12,6 +12,12 @@
           option(
               "no-update", None, "Do not update locked versions, only refresh lock file."
           ),
  +        option(
  +            "check",
  +            None,
  +            "Check that the <comment>poetry.lock</> file corresponds to the current version "
  +            "of <comment>pyproject.toml</>.",
  +        ),
       ]
   
       help = """
  @@ -29,6 +35,13 @@
               self.poetry.config.get("experimental.new-installer", False)
           )
   
  +        if self.option("check"):
  +            return (
  +                0
  +                if self.poetry.locker.is_locked() and self.poetry.locker.is_fresh()
  +                else 1
  +            )
  +
           self._installer.lock(update=not self.option("no-update"))
   
           return self._installer.run()
  
verification_info: {"golden_diff": "diff --git a/poetry/console/commands/lock.py b/poetry/console/commands/lock.py\n--- a/poetry/console/commands/lock.py\n+++ b/poetry/console/commands/lock.py\n@@ -12,6 +12,12 @@\n         option(\n             \"no-update\", None, \"Do not update locked versions, only refresh lock file.\"\n         ),\n+        option(\n+            \"check\",\n+            None,\n+            \"Check that the <comment>poetry.lock</> file corresponds to the current version \"\n+            \"of <comment>pyproject.toml</>.\",\n+        ),\n     ]\n \n     help = \"\"\"\n@@ -29,6 +35,13 @@\n             self.poetry.config.get(\"experimental.new-installer\", False)\n         )\n \n+        if self.option(\"check\"):\n+            return (\n+                0\n+                if self.poetry.locker.is_locked() and self.poetry.locker.is_fresh()\n+                else 1\n+            )\n+\n         self._installer.lock(update=not self.option(\"no-update\"))\n \n         return self._installer.run()\n", "issue": "command to check lock file\n<!-- Checked checkbox should look like this: [x] -->\r\n- [X] I have searched the [issues](https://github.com/sdispater/poetry/issues) of this repo and believe that this is not a duplicate.\r\n\r\n## Issue\r\n\r\nWould it be possible to add a `poetry check` command (oh, I see you'e used that already, maybe the command could be extended or have a `poetry lock --check`?) that will return zero if the current poetry.lock is both correct w.r.t. the pyproject.toml (ie: packages match) *and* that it matches the output of `poetry lock`.\r\n\n", "before_files": [{"content": "from cleo.helpers import option\n\nfrom .installer_command import InstallerCommand\n\n\nclass LockCommand(InstallerCommand):\n\n    name = \"lock\"\n    description = \"Locks the project dependencies.\"\n\n    options = [\n        option(\n            \"no-update\", None, \"Do not update locked versions, only refresh lock file.\"\n        ),\n    ]\n\n    help = \"\"\"\nThe <info>lock</info> command reads the <comment>pyproject.toml</> file from the\ncurrent directory, processes it, and locks the dependencies in the <comment>poetry.lock</>\nfile.\n\n<info>poetry lock</info>\n\"\"\"\n\n    loggers = [\"poetry.repositories.pypi_repository\"]\n\n    def handle(self) -> int:\n        self._installer.use_executor(\n            self.poetry.config.get(\"experimental.new-installer\", False)\n        )\n\n        self._installer.lock(update=not self.option(\"no-update\"))\n\n        return self._installer.run()\n", "path": "poetry/console/commands/lock.py"}]}