prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  False positive EANSIBLE0014 also flags vars in shell task
  # Issue Type
  - Bug report
  
  # Ansible and Ansible Lint details
  ```
  ansible --version
  ansible 2.3.0.0
  ansible-lint --version
  ansible-lint 3.4.13
  ```
  
  - ansible installation method: pip
  - ansible-lint installation method: pip
  
  # Desired Behaviour
  
  EANSIBLE0014 should validate only command task, not shell.
  
  # Actual Behaviour (Bug report only)
  
  When ansible-lint validating playbook with shell tasks with env vars
  ```
  - hosts: "localhost"
    gather_facts: no
    become: no
    tasks:
        - shell: 'MYVAR="$(date)" env | grep MY'
  ```
  it fails and complains about Env vars shouldn't be in command
  ```
  test-play.yaml:5: [EANSIBLE0014] Environment variables don't work as part of command
  ```
  
  
  </issue>
  <code>
  [start of lib/ansiblelint/rules/EnvVarsInCommandRule.py]
  1 # Copyright (c) 2016 Will Thames <will@thames.id.au>
  2 #
  3 # Permission is hereby granted, free of charge, to any person obtaining a copy
  4 # of this software and associated documentation files (the "Software"), to deal
  5 # in the Software without restriction, including without limitation the rights
  6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  7 # copies of the Software, and to permit persons to whom the Software is
  8 # furnished to do so, subject to the following conditions:
  9 #
  10 # The above copyright notice and this permission notice shall be included in
  11 # all copies or substantial portions of the Software.
  12 #
  13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  19 # THE SOFTWARE.
  20 
  21 from ansiblelint import AnsibleLintRule
  22 from ansiblelint.utils import LINE_NUMBER_KEY, FILENAME_KEY, get_first_cmd_arg
  23 
  24 
  25 class EnvVarsInCommandRule(AnsibleLintRule):
  26     id = '304'
  27     shortdesc = "Environment variables don't work as part of command"
  28     description = (
  29         'Environment variables should be passed to ``shell`` or ``command`` '
  30         'through environment argument'
  31     )
  32     severity = 'VERY_HIGH'
  33     tags = ['command-shell', 'bug', 'ANSIBLE0014']
  34     version_added = 'historic'
  35 
  36     expected_args = ['chdir', 'creates', 'executable', 'removes', 'stdin', 'warn',
  37                      'cmd', '__ansible_module__', '__ansible_arguments__',
  38                      LINE_NUMBER_KEY, FILENAME_KEY]
  39 
  40     def matchtask(self, file, task):
  41         if task["action"]["__ansible_module__"] in ['shell', 'command']:
  42             first_cmd_arg = get_first_cmd_arg(task)
  43             if not first_cmd_arg:
  44                 return
  45 
  46             return any([arg not in self.expected_args for arg in task['action']] +
  47                        ["=" in first_cmd_arg])
  48
  [end of lib/ansiblelint/rules/EnvVarsInCommandRule.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/lib/ansiblelint/rules/EnvVarsInCommandRule.py b/lib/ansiblelint/rules/EnvVarsInCommandRule.py
  --- a/lib/ansiblelint/rules/EnvVarsInCommandRule.py
  +++ b/lib/ansiblelint/rules/EnvVarsInCommandRule.py
  @@ -38,7 +38,7 @@
                        LINE_NUMBER_KEY, FILENAME_KEY]
   
       def matchtask(self, file, task):
  -        if task["action"]["__ansible_module__"] in ['shell', 'command']:
  +        if task["action"]["__ansible_module__"] in ['command']:
               first_cmd_arg = get_first_cmd_arg(task)
               if not first_cmd_arg:
                   return
  
verification_info: {"golden_diff": "diff --git a/lib/ansiblelint/rules/EnvVarsInCommandRule.py b/lib/ansiblelint/rules/EnvVarsInCommandRule.py\n--- a/lib/ansiblelint/rules/EnvVarsInCommandRule.py\n+++ b/lib/ansiblelint/rules/EnvVarsInCommandRule.py\n@@ -38,7 +38,7 @@\n                      LINE_NUMBER_KEY, FILENAME_KEY]\n \n     def matchtask(self, file, task):\n-        if task[\"action\"][\"__ansible_module__\"] in ['shell', 'command']:\n+        if task[\"action\"][\"__ansible_module__\"] in ['command']:\n             first_cmd_arg = get_first_cmd_arg(task)\n             if not first_cmd_arg:\n                 return\n", "issue": "False positive EANSIBLE0014 also flags vars in shell task\n# Issue Type\r\n- Bug report\r\n\r\n# Ansible and Ansible Lint details\r\n```\r\nansible --version\r\nansible 2.3.0.0\r\nansible-lint --version\r\nansible-lint 3.4.13\r\n```\r\n\r\n- ansible installation method: pip\r\n- ansible-lint installation method: pip\r\n\r\n# Desired Behaviour\r\n\r\nEANSIBLE0014 should validate only command task, not shell.\r\n\r\n# Actual Behaviour (Bug report only)\r\n\r\nWhen ansible-lint validating playbook with shell tasks with env vars\r\n```\r\n- hosts: \"localhost\"\r\n  gather_facts: no\r\n  become: no\r\n  tasks:\r\n      - shell: 'MYVAR=\"$(date)\" env | grep MY'\r\n```\r\nit fails and complains about Env vars shouldn't be in command\r\n```\r\ntest-play.yaml:5: [EANSIBLE0014] Environment variables don't work as part of command\r\n```\r\n\n", "before_files": [{"content": "# Copyright (c) 2016 Will Thames <will@thames.id.au>\n#\n# Permission is hereby granted, free of charge, to any person obtaining a copy\n# of this software and associated documentation files (the \"Software\"), to deal\n# in the Software without restriction, including without limitation the rights\n# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n# copies of the Software, and to permit persons to whom the Software is\n# furnished to do so, subject to the following conditions:\n#\n# The above copyright notice and this permission notice shall be included in\n# all copies or substantial portions of the Software.\n#\n# THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# THE SOFTWARE.\n\nfrom ansiblelint import AnsibleLintRule\nfrom ansiblelint.utils import LINE_NUMBER_KEY, FILENAME_KEY, get_first_cmd_arg\n\n\nclass EnvVarsInCommandRule(AnsibleLintRule):\n    id = '304'\n    shortdesc = \"Environment variables don't work as part of command\"\n    description = (\n        'Environment variables should be passed to ``shell`` or ``command`` '\n        'through environment argument'\n    )\n    severity = 'VERY_HIGH'\n    tags = ['command-shell', 'bug', 'ANSIBLE0014']\n    version_added = 'historic'\n\n    expected_args = ['chdir', 'creates', 'executable', 'removes', 'stdin', 'warn',\n                     'cmd', '__ansible_module__', '__ansible_arguments__',\n                     LINE_NUMBER_KEY, FILENAME_KEY]\n\n    def matchtask(self, file, task):\n        if task[\"action\"][\"__ansible_module__\"] in ['shell', 'command']:\n            first_cmd_arg = get_first_cmd_arg(task)\n            if not first_cmd_arg:\n                return\n\n            return any([arg not in self.expected_args for arg in task['action']] +\n                       [\"=\" in first_cmd_arg])\n", "path": "lib/ansiblelint/rules/EnvVarsInCommandRule.py"}]}