We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN 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
```


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `lib/ansiblelint/rules/EnvVarsInCommandRule.py`
Content:
```
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 FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

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

{"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"}], "after_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 ['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"}]}