We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Add type checking to role metadata in rule 701 MetaMainHasInfoRule


--- 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/MetaMainHasInfoRule.py`
Content:
```
1 # Copyright (c) 2016, Will Thames and contributors
2 # Copyright (c) 2018, Ansible Project
3 
4 from ansiblelint import AnsibleLintRule
5 
6 
7 class MetaMainHasInfoRule(AnsibleLintRule):
8     id = '701'
9     shortdesc = 'meta/main.yml should contain relevant info'
10     info = [
11         'author',
12         'description',
13         'license',
14         'min_ansible_version',
15         'platforms',
16     ]
17     description = (
18         'meta/main.yml should contain: ``{}``'.format(', '.join(info))
19     )
20     severity = 'HIGH'
21     tags = ['metadata']
22     version_added = 'v4.0.0'
23 
24     def matchplay(self, file, data):
25         if file['type'] != 'meta':
26             return False
27 
28         galaxy_info = data.get('galaxy_info', None)
29         if not galaxy_info:
30             return [({'meta/main.yml': data},
31                     "No 'galaxy_info' found")]
32 
33         results = []
34         for info in self.info:
35             if not galaxy_info.get(info, None):
36                 results.append(({'meta/main.yml': data},
37                                 'Role info should contain %s' % info))
38 
39         platforms = galaxy_info.get('platforms', None)
40         if platforms:
41             for platform in platforms:
42                 if not platform.get('name', None):
43                     results.append(({'meta/main.yml': data},
44                                     'Platform should contain name'))
45 
46         return results
47
```
--- 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/MetaMainHasInfoRule.py b/lib/ansiblelint/rules/MetaMainHasInfoRule.py
--- a/lib/ansiblelint/rules/MetaMainHasInfoRule.py
+++ b/lib/ansiblelint/rules/MetaMainHasInfoRule.py
@@ -1,6 +1,8 @@
 # Copyright (c) 2016, Will Thames and contributors
 # Copyright (c) 2018, Ansible Project
 
+import six
+
 from ansiblelint import AnsibleLintRule
 
 
@@ -36,11 +38,29 @@
                 results.append(({'meta/main.yml': data},
                                 'Role info should contain %s' % info))
 
+        for info in ['author', 'description']:
+            if not galaxy_info.get(info):
+                continue
+            if not isinstance(galaxy_info.get(info), six.string_types):
+                results.append(({'meta/main.yml': data},
+                                '%s should be a string' % info))
+
         platforms = galaxy_info.get('platforms', None)
-        if platforms:
-            for platform in platforms:
-                if not platform.get('name', None):
-                    results.append(({'meta/main.yml': data},
-                                    'Platform should contain name'))
+        if not platforms:
+            return results
+
+        if not isinstance(platforms, list):
+            results.append(({'meta/main.yml': data},
+                            'Platforms should be a list of dictionaries'))
+            return results
+
+        for platform in platforms:
+            if not isinstance(platform, dict):
+                results.append(({'meta/main.yml': data},
+                                'Platforms should be a list of dictionaries'))
+                continue
+            if not platform.get('name', None):
+                results.append(({'meta/main.yml': data},
+                                'Platform should contain name'))
 
         return results

{"golden_diff": "diff --git a/lib/ansiblelint/rules/MetaMainHasInfoRule.py b/lib/ansiblelint/rules/MetaMainHasInfoRule.py\n--- a/lib/ansiblelint/rules/MetaMainHasInfoRule.py\n+++ b/lib/ansiblelint/rules/MetaMainHasInfoRule.py\n@@ -1,6 +1,8 @@\n # Copyright (c) 2016, Will Thames and contributors\n # Copyright (c) 2018, Ansible Project\n \n+import six\n+\n from ansiblelint import AnsibleLintRule\n \n \n@@ -36,11 +38,29 @@\n                 results.append(({'meta/main.yml': data},\n                                 'Role info should contain %s' % info))\n \n+        for info in ['author', 'description']:\n+            if not galaxy_info.get(info):\n+                continue\n+            if not isinstance(galaxy_info.get(info), six.string_types):\n+                results.append(({'meta/main.yml': data},\n+                                '%s should be a string' % info))\n+\n         platforms = galaxy_info.get('platforms', None)\n-        if platforms:\n-            for platform in platforms:\n-                if not platform.get('name', None):\n-                    results.append(({'meta/main.yml': data},\n-                                    'Platform should contain name'))\n+        if not platforms:\n+            return results\n+\n+        if not isinstance(platforms, list):\n+            results.append(({'meta/main.yml': data},\n+                            'Platforms should be a list of dictionaries'))\n+            return results\n+\n+        for platform in platforms:\n+            if not isinstance(platform, dict):\n+                results.append(({'meta/main.yml': data},\n+                                'Platforms should be a list of dictionaries'))\n+                continue\n+            if not platform.get('name', None):\n+                results.append(({'meta/main.yml': data},\n+                                'Platform should contain name'))\n \n         return results\n", "issue": "Add type checking to role metadata in rule 701 MetaMainHasInfoRule\n\n", "before_files": [{"content": "# Copyright (c) 2016, Will Thames and contributors\n# Copyright (c) 2018, Ansible Project\n\nfrom ansiblelint import AnsibleLintRule\n\n\nclass MetaMainHasInfoRule(AnsibleLintRule):\n    id = '701'\n    shortdesc = 'meta/main.yml should contain relevant info'\n    info = [\n        'author',\n        'description',\n        'license',\n        'min_ansible_version',\n        'platforms',\n    ]\n    description = (\n        'meta/main.yml should contain: ``{}``'.format(', '.join(info))\n    )\n    severity = 'HIGH'\n    tags = ['metadata']\n    version_added = 'v4.0.0'\n\n    def matchplay(self, file, data):\n        if file['type'] != 'meta':\n            return False\n\n        galaxy_info = data.get('galaxy_info', None)\n        if not galaxy_info:\n            return [({'meta/main.yml': data},\n                    \"No 'galaxy_info' found\")]\n\n        results = []\n        for info in self.info:\n            if not galaxy_info.get(info, None):\n                results.append(({'meta/main.yml': data},\n                                'Role info should contain %s' % info))\n\n        platforms = galaxy_info.get('platforms', None)\n        if platforms:\n            for platform in platforms:\n                if not platform.get('name', None):\n                    results.append(({'meta/main.yml': data},\n                                    'Platform should contain name'))\n\n        return results\n", "path": "lib/ansiblelint/rules/MetaMainHasInfoRule.py"}], "after_files": [{"content": "# Copyright (c) 2016, Will Thames and contributors\n# Copyright (c) 2018, Ansible Project\n\nimport six\n\nfrom ansiblelint import AnsibleLintRule\n\n\nclass MetaMainHasInfoRule(AnsibleLintRule):\n    id = '701'\n    shortdesc = 'meta/main.yml should contain relevant info'\n    info = [\n        'author',\n        'description',\n        'license',\n        'min_ansible_version',\n        'platforms',\n    ]\n    description = (\n        'meta/main.yml should contain: ``{}``'.format(', '.join(info))\n    )\n    severity = 'HIGH'\n    tags = ['metadata']\n    version_added = 'v4.0.0'\n\n    def matchplay(self, file, data):\n        if file['type'] != 'meta':\n            return False\n\n        galaxy_info = data.get('galaxy_info', None)\n        if not galaxy_info:\n            return [({'meta/main.yml': data},\n                    \"No 'galaxy_info' found\")]\n\n        results = []\n        for info in self.info:\n            if not galaxy_info.get(info, None):\n                results.append(({'meta/main.yml': data},\n                                'Role info should contain %s' % info))\n\n        for info in ['author', 'description']:\n            if not galaxy_info.get(info):\n                continue\n            if not isinstance(galaxy_info.get(info), six.string_types):\n                results.append(({'meta/main.yml': data},\n                                '%s should be a string' % info))\n\n        platforms = galaxy_info.get('platforms', None)\n        if not platforms:\n            return results\n\n        if not isinstance(platforms, list):\n            results.append(({'meta/main.yml': data},\n                            'Platforms should be a list of dictionaries'))\n            return results\n\n        for platform in platforms:\n            if not isinstance(platform, dict):\n                results.append(({'meta/main.yml': data},\n                                'Platforms should be a list of dictionaries'))\n                continue\n            if not platform.get('name', None):\n                results.append(({'meta/main.yml': data},\n                                'Platform should contain name'))\n\n        return results\n", "path": "lib/ansiblelint/rules/MetaMainHasInfoRule.py"}]}