libv8 6.7.288.46.1 → 7.3.492.27.0beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (408) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +3 -0
  3. data/CHANGELOG.md +4 -0
  4. data/README.md +2 -0
  5. data/ext/libv8/builder.rb +6 -2
  6. data/lib/libv8/version.rb +1 -1
  7. data/vendor/depot_tools/.gitattributes +1 -0
  8. data/vendor/depot_tools/.gitignore +7 -0
  9. data/vendor/depot_tools/CROS_OWNERS +5 -0
  10. data/vendor/depot_tools/OWNERS +12 -1
  11. data/vendor/depot_tools/PRESUBMIT.py +16 -9
  12. data/vendor/depot_tools/README.md +9 -2
  13. data/vendor/depot_tools/autoninja +14 -6
  14. data/vendor/depot_tools/autoninja.bat +11 -1
  15. data/vendor/depot_tools/autoninja.py +40 -18
  16. data/vendor/depot_tools/bb +12 -0
  17. data/vendor/depot_tools/bb.bat +7 -0
  18. data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
  19. data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +1 -1
  20. data/vendor/depot_tools/bootstrap/win/win_tools.py +2 -1
  21. data/vendor/depot_tools/buildbucket.py +57 -4
  22. data/vendor/depot_tools/cipd +157 -44
  23. data/vendor/depot_tools/cipd.bat +51 -14
  24. data/vendor/depot_tools/cipd.ps1 +104 -42
  25. data/vendor/depot_tools/cipd_client_version +1 -1
  26. data/vendor/depot_tools/cipd_client_version.digests +21 -0
  27. data/vendor/depot_tools/cipd_manifest.txt +19 -6
  28. data/vendor/depot_tools/cipd_manifest.versions +318 -0
  29. data/vendor/depot_tools/clang_format.py +4 -4
  30. data/vendor/depot_tools/cpplint.py +44 -199
  31. data/vendor/depot_tools/dart_format.py +2 -2
  32. data/vendor/depot_tools/detect_host_arch.py +8 -3
  33. data/vendor/depot_tools/download_from_google_storage.py +47 -39
  34. data/vendor/depot_tools/fetch.py +30 -18
  35. data/vendor/depot_tools/fetch_configs/android_internal.py +34 -0
  36. data/vendor/depot_tools/fetch_configs/chromium.py +18 -1
  37. data/vendor/depot_tools/fetch_configs/config_util.py +4 -2
  38. data/vendor/depot_tools/fetch_configs/inspector_protocol.py +40 -0
  39. data/vendor/depot_tools/fetch_configs/node-ci.py +41 -0
  40. data/vendor/depot_tools/fix_encoding.py +3 -3
  41. data/vendor/depot_tools/gclient +1 -1
  42. data/vendor/depot_tools/gclient.py +415 -198
  43. data/vendor/depot_tools/gclient_eval.py +220 -171
  44. data/vendor/depot_tools/gclient_paths.py +142 -0
  45. data/vendor/depot_tools/gclient_scm.py +200 -51
  46. data/vendor/depot_tools/gclient_utils.py +88 -191
  47. data/vendor/depot_tools/gerrit_client.py +13 -0
  48. data/vendor/depot_tools/gerrit_util.py +158 -23
  49. data/vendor/depot_tools/git-nav-upstream +1 -1
  50. data/vendor/depot_tools/git_cache.py +77 -24
  51. data/vendor/depot_tools/git_cl.py +705 -1099
  52. data/vendor/depot_tools/git_common.py +9 -6
  53. data/vendor/depot_tools/git_map_branches.py +19 -2
  54. data/vendor/depot_tools/git_nav_downstream.py +3 -4
  55. data/vendor/depot_tools/git_rebase_update.py +14 -0
  56. data/vendor/depot_tools/git_reparent_branch.py +8 -2
  57. data/vendor/depot_tools/gn.py +38 -3
  58. data/vendor/depot_tools/gsutil.py +8 -3
  59. data/vendor/depot_tools/gsutil.py.bat +15 -0
  60. data/vendor/depot_tools/gsutil.vpython +16 -0
  61. data/vendor/depot_tools/infra/config/OWNERS +0 -1
  62. data/vendor/depot_tools/infra/config/recipes.cfg +3 -2
  63. data/vendor/depot_tools/lucicfg +12 -0
  64. data/vendor/depot_tools/lucicfg.bat +7 -0
  65. data/vendor/depot_tools/man/html/git-map-branches.html +34 -2
  66. data/vendor/depot_tools/man/html/git-new-branch.html +40 -32
  67. data/vendor/depot_tools/man/man1/git-map-branches.1 +24 -5
  68. data/vendor/depot_tools/man/man1/git-new-branch.1 +35 -27
  69. data/vendor/depot_tools/man/src/git-map-branches.demo.1.sh +1 -0
  70. data/vendor/depot_tools/man/src/git-map-branches.txt +10 -0
  71. data/vendor/depot_tools/man/src/git-new-branch.demo.1.sh +9 -4
  72. data/vendor/depot_tools/man/src/git-new-branch.txt +1 -1
  73. data/vendor/depot_tools/metrics.README.md +98 -0
  74. data/vendor/depot_tools/metrics.py +296 -0
  75. data/vendor/depot_tools/metrics_utils.py +303 -0
  76. data/vendor/depot_tools/my_activity.py +91 -29
  77. data/vendor/depot_tools/ninja +1 -1
  78. data/vendor/depot_tools/ninjalog.README.md +64 -0
  79. data/vendor/depot_tools/ninjalog_uploader.py +232 -0
  80. data/vendor/depot_tools/ninjalog_uploader_wrapper.py +116 -0
  81. data/vendor/depot_tools/owners.py +30 -13
  82. data/vendor/depot_tools/owners_finder.py +5 -2
  83. data/vendor/depot_tools/presubmit_canned_checks.py +188 -29
  84. data/vendor/depot_tools/presubmit_support.py +18 -41
  85. data/vendor/depot_tools/pylintrc +23 -19
  86. data/vendor/depot_tools/recipes/OWNERS +2 -0
  87. data/vendor/depot_tools/recipes/README.recipes.md +344 -151
  88. data/vendor/depot_tools/recipes/recipe_modules/bot_update/OWNERS +2 -0
  89. data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +2 -16
  90. data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +141 -99
  91. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +5 -8
  92. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +5 -8
  93. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +6 -98
  94. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +4 -9
  95. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +45 -5
  96. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +4 -9
  97. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +4 -9
  98. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{tryjob.json → input_commit_with_id_without_repo.json} +6 -11
  99. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{tryjob_empty_revision.json → multiple_patch_refs.json} +8 -9
  100. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +19 -29
  101. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange.json → refs.json} +4 -9
  102. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +4 -9
  103. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +51 -6
  104. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +50 -6
  105. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +51 -6
  106. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +17 -25
  107. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +17 -25
  108. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +18 -26
  109. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +18 -26
  110. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +26 -28
  111. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +45 -5
  112. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +17 -25
  113. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +13 -0
  114. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json +13 -152
  115. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +4 -9
  116. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +185 -202
  117. data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +52 -157
  118. data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +5 -14
  119. data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +34 -0
  120. data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +14 -2
  121. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +4 -5
  122. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +4 -5
  123. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +7 -5
  124. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +4 -5
  125. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +4 -5
  126. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +9 -3
  127. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +9 -3
  128. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +9 -3
  129. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +4 -5
  130. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +2 -3
  131. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +2 -3
  132. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +2 -3
  133. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +2 -3
  134. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +2 -3
  135. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +2 -3
  136. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +2 -3
  137. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +2 -3
  138. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +2 -3
  139. data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +2 -3
  140. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +13 -8
  141. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +18 -12
  142. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +18 -12
  143. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +18 -12
  144. data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.py +3 -0
  145. data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +1 -0
  146. data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +58 -46
  147. data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +65 -22
  148. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +20 -21
  149. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +20 -21
  150. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +20 -21
  151. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +20 -21
  152. data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +5 -2
  153. data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +62 -14
  154. data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +24 -38
  155. data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +56 -50
  156. data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +15 -9
  157. data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +4 -1
  158. data/vendor/depot_tools/recipes/recipe_modules/git/api.py +34 -22
  159. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +5 -6
  160. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +5 -6
  161. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +5 -6
  162. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +5 -6
  163. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_luci.json +222 -0
  164. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +5 -6
  165. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +5 -6
  166. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +224 -0
  167. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +10 -6
  168. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +5 -7
  169. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +5 -6
  170. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +5 -6
  171. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +5 -7
  172. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +5 -6
  173. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +10 -5
  174. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +5 -6
  175. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +8 -9
  176. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +5 -6
  177. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +12 -8
  178. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +5 -6
  179. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +5 -6
  180. data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +27 -11
  181. data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +1 -1
  182. data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +12 -13
  183. data/vendor/depot_tools/recipes/recipe_modules/gitiles/__init__.py +5 -0
  184. data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +120 -5
  185. data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +45 -3
  186. data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.py +25 -0
  187. data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +56 -4
  188. data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +6 -0
  189. data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.py +49 -0
  190. data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +24 -13
  191. data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +13 -14
  192. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/basic.json +2 -3
  193. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_linux.json +2 -3
  194. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_mac.json +2 -3
  195. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_win.json +2 -3
  196. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_linux.json +2 -3
  197. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_mac.json +2 -3
  198. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_win.json +2 -3
  199. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_linux.json +2 -3
  200. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_mac.json +2 -3
  201. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_win.json +2 -3
  202. data/vendor/depot_tools/recipes/recipe_modules/infra_paths/path_config.py +1 -2
  203. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +35 -0
  204. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +116 -0
  205. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +22 -0
  206. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +82 -0
  207. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +22 -0
  208. data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +23 -0
  209. data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +1 -0
  210. data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +2 -7
  211. data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +7 -6
  212. data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +1 -0
  213. data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +117 -8
  214. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +4 -5
  215. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +7 -4
  216. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +98 -7
  217. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +147 -0
  218. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +8 -5
  219. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +8 -5
  220. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +9 -6
  221. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +9 -6
  222. data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +27 -2
  223. data/vendor/depot_tools/recipes/recipe_modules/tryserver/test_api.py +14 -0
  224. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/__init__.py +25 -0
  225. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/api.py +137 -0
  226. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +22 -0
  227. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +22 -0
  228. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +107 -0
  229. data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +26 -0
  230. data/vendor/depot_tools/recipes/recipes.py +37 -27
  231. data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +7 -10
  232. data/vendor/depot_tools/repo +34 -8
  233. data/vendor/depot_tools/roll_dep.py +52 -49
  234. data/vendor/depot_tools/scm.py +38 -23
  235. data/vendor/depot_tools/setup_color.py +4 -2
  236. data/vendor/depot_tools/split_cl.py +32 -4
  237. data/vendor/depot_tools/subprocess2.py +22 -4
  238. data/vendor/depot_tools/third_party/httplib2/README.chromium +2 -2
  239. data/vendor/depot_tools/third_party/httplib2/__init__.py +242 -158
  240. data/vendor/depot_tools/third_party/httplib2/cacerts.txt +57 -44
  241. data/vendor/depot_tools/third_party/httplib2/socks.py +15 -5
  242. data/vendor/depot_tools/third_party/logilab/README.chromium +2 -4
  243. data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +2 -1
  244. data/vendor/depot_tools/third_party/logilab/astroid/__init__.py +10 -5
  245. data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +5 -5
  246. data/vendor/depot_tools/third_party/logilab/astroid/arguments.py +233 -0
  247. data/vendor/depot_tools/third_party/logilab/astroid/as_string.py +82 -33
  248. data/vendor/depot_tools/third_party/logilab/astroid/bases.py +137 -153
  249. data/vendor/depot_tools/third_party/logilab/astroid/brain/{builtin_inference.py → brain_builtin_inference.py} +117 -26
  250. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_dateutil.py +15 -0
  251. data/vendor/depot_tools/third_party/logilab/astroid/brain/{py2gi.py → brain_gi.py} +48 -8
  252. data/vendor/depot_tools/third_party/logilab/astroid/brain/{py2mechanize.py → brain_mechanize.py} +0 -0
  253. data/vendor/depot_tools/third_party/logilab/astroid/brain/{pynose.py → brain_nose.py} +4 -1
  254. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_numpy.py +62 -0
  255. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_pytest.py +76 -0
  256. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_qt.py +44 -0
  257. data/vendor/depot_tools/third_party/logilab/astroid/brain/{pysix_moves.py → brain_six.py} +28 -1
  258. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_ssl.py +65 -0
  259. data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_stdlib.py +473 -0
  260. data/vendor/depot_tools/third_party/logilab/astroid/builder.py +104 -81
  261. data/vendor/depot_tools/third_party/logilab/astroid/context.py +81 -0
  262. data/vendor/depot_tools/third_party/logilab/astroid/decorators.py +75 -0
  263. data/vendor/depot_tools/third_party/logilab/astroid/exceptions.py +20 -0
  264. data/vendor/depot_tools/third_party/logilab/astroid/inference.py +137 -183
  265. data/vendor/depot_tools/third_party/logilab/astroid/manager.py +45 -169
  266. data/vendor/depot_tools/third_party/logilab/astroid/mixins.py +37 -14
  267. data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +112 -41
  268. data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +243 -156
  269. data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +35 -22
  270. data/vendor/depot_tools/third_party/logilab/astroid/objects.py +186 -0
  271. data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +157 -102
  272. data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +32 -8
  273. data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +372 -309
  274. data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +652 -420
  275. data/vendor/depot_tools/third_party/logilab/astroid/test_utils.py +4 -21
  276. data/vendor/depot_tools/third_party/logilab/astroid/transforms.py +96 -0
  277. data/vendor/depot_tools/third_party/logilab/astroid/util.py +89 -0
  278. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/LICENSE +19 -0
  279. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/README.chromium +11 -0
  280. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/__init__.py +20 -0
  281. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/cext.c +1421 -0
  282. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/compat.py +9 -0
  283. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/simple.py +246 -0
  284. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/slots.py +414 -0
  285. data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/utils.py +13 -0
  286. data/vendor/depot_tools/third_party/logilab/wrapt/LICENSE +24 -0
  287. data/vendor/depot_tools/third_party/logilab/wrapt/README.chromium +11 -0
  288. data/vendor/depot_tools/third_party/logilab/wrapt/__init__.py +19 -0
  289. data/vendor/depot_tools/third_party/logilab/wrapt/_wrappers.c +2729 -0
  290. data/vendor/depot_tools/third_party/logilab/wrapt/arguments.py +96 -0
  291. data/vendor/depot_tools/third_party/logilab/wrapt/decorators.py +512 -0
  292. data/vendor/depot_tools/third_party/logilab/wrapt/importer.py +228 -0
  293. data/vendor/depot_tools/third_party/logilab/wrapt/wrappers.py +901 -0
  294. data/vendor/depot_tools/third_party/pylint/README.chromium +2 -25
  295. data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +13 -3
  296. data/vendor/depot_tools/third_party/pylint/checkers/__init__.py +1 -2
  297. data/vendor/depot_tools/third_party/pylint/checkers/async.py +82 -0
  298. data/vendor/depot_tools/third_party/pylint/checkers/base.py +893 -119
  299. data/vendor/depot_tools/third_party/pylint/checkers/classes.py +342 -204
  300. data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +51 -34
  301. data/vendor/depot_tools/third_party/pylint/checkers/exceptions.py +84 -47
  302. data/vendor/depot_tools/third_party/pylint/checkers/format.py +55 -30
  303. data/vendor/depot_tools/third_party/pylint/checkers/imports.py +314 -73
  304. data/vendor/depot_tools/third_party/pylint/checkers/logging.py +10 -8
  305. data/vendor/depot_tools/third_party/pylint/checkers/misc.py +2 -1
  306. data/vendor/depot_tools/third_party/pylint/checkers/newstyle.py +45 -48
  307. data/vendor/depot_tools/third_party/pylint/checkers/python3.py +31 -21
  308. data/vendor/depot_tools/third_party/pylint/checkers/raw_metrics.py +3 -3
  309. data/vendor/depot_tools/third_party/pylint/checkers/similar.py +4 -5
  310. data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +24 -10
  311. data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +120 -56
  312. data/vendor/depot_tools/third_party/pylint/checkers/strings.py +38 -35
  313. data/vendor/depot_tools/third_party/pylint/checkers/typecheck.py +485 -138
  314. data/vendor/depot_tools/third_party/pylint/checkers/utils.py +319 -142
  315. data/vendor/depot_tools/third_party/pylint/checkers/variables.py +329 -207
  316. data/vendor/depot_tools/third_party/pylint/config.py +739 -76
  317. data/vendor/depot_tools/third_party/pylint/epylint.py +9 -5
  318. data/vendor/depot_tools/third_party/pylint/extensions/__init__.py +0 -0
  319. data/vendor/depot_tools/third_party/pylint/extensions/check_docs.py +311 -0
  320. data/vendor/depot_tools/third_party/pylint/extensions/check_elif.py +62 -0
  321. data/vendor/depot_tools/third_party/{logilab/common → pylint}/graph.py +30 -133
  322. data/vendor/depot_tools/third_party/pylint/gui.py +2 -2
  323. data/vendor/depot_tools/third_party/pylint/interfaces.py +21 -3
  324. data/vendor/depot_tools/third_party/pylint/lint.py +123 -140
  325. data/vendor/depot_tools/third_party/pylint/pyreverse/diadefslib.py +10 -13
  326. data/vendor/depot_tools/third_party/pylint/pyreverse/diagrams.py +15 -4
  327. data/vendor/depot_tools/third_party/pylint/pyreverse/inspector.py +372 -0
  328. data/vendor/depot_tools/third_party/pylint/pyreverse/main.py +30 -7
  329. data/vendor/depot_tools/third_party/pylint/pyreverse/utils.py +80 -2
  330. data/vendor/depot_tools/third_party/{logilab/common → pylint/pyreverse}/vcgutils.py +19 -37
  331. data/vendor/depot_tools/third_party/pylint/pyreverse/writer.py +3 -4
  332. data/vendor/depot_tools/third_party/pylint/reporters/__init__.py +34 -18
  333. data/vendor/depot_tools/third_party/pylint/reporters/guireporter.py +1 -1
  334. data/vendor/depot_tools/third_party/pylint/reporters/html.py +10 -3
  335. data/vendor/depot_tools/third_party/pylint/reporters/json.py +10 -4
  336. data/vendor/depot_tools/third_party/pylint/reporters/text.py +94 -3
  337. data/vendor/depot_tools/third_party/pylint/reporters/ureports/__init__.py +106 -0
  338. data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/html_writer.py +17 -57
  339. data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/nodes.py +52 -74
  340. data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/text_writer.py +14 -60
  341. data/vendor/depot_tools/third_party/pylint/testutils.py +22 -20
  342. data/vendor/depot_tools/third_party/pylint/utils.py +268 -44
  343. data/vendor/depot_tools/third_party/repo/progress.py +42 -0
  344. data/vendor/depot_tools/update_depot_tools +1 -1
  345. data/vendor/depot_tools/upload_metrics.py +25 -0
  346. data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +45 -15
  347. data/vendor/depot_tools/win_toolchain/package_from_installed.py +71 -24
  348. data/vendor/depot_tools/yapf +1 -1
  349. data/vendor/depot_tools/yapf.bat +1 -1
  350. metadata +92 -77
  351. data/vendor/depot_tools/git-crsync +0 -3
  352. data/vendor/depot_tools/infra/config/cq.cfg +0 -32
  353. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref.json +0 -29
  354. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref_custom.json +0 -29
  355. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/buildbot.json +0 -105
  356. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/shallow.json +0 -195
  357. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +0 -248
  358. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8.json +0 -248
  359. data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name_no_patch.json +0 -105
  360. data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/apply_gerrit.py +0 -33
  361. data/vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py +0 -31
  362. data/vendor/depot_tools/third_party/logilab/astroid/brain/py2qt4.py +0 -22
  363. data/vendor/depot_tools/third_party/logilab/astroid/brain/py2stdlib.py +0 -334
  364. data/vendor/depot_tools/third_party/logilab/astroid/inspector.py +0 -273
  365. data/vendor/depot_tools/third_party/logilab/astroid/utils.py +0 -239
  366. data/vendor/depot_tools/third_party/logilab/common/LICENSE.txt +0 -339
  367. data/vendor/depot_tools/third_party/logilab/common/README.chromium +0 -11
  368. data/vendor/depot_tools/third_party/logilab/common/__init__.py +0 -175
  369. data/vendor/depot_tools/third_party/logilab/common/__pkginfo__.py +0 -57
  370. data/vendor/depot_tools/third_party/logilab/common/cache.py +0 -114
  371. data/vendor/depot_tools/third_party/logilab/common/changelog.py +0 -238
  372. data/vendor/depot_tools/third_party/logilab/common/clcommands.py +0 -334
  373. data/vendor/depot_tools/third_party/logilab/common/cli.py +0 -211
  374. data/vendor/depot_tools/third_party/logilab/common/compat.py +0 -78
  375. data/vendor/depot_tools/third_party/logilab/common/configuration.py +0 -1105
  376. data/vendor/depot_tools/third_party/logilab/common/contexts.py +0 -5
  377. data/vendor/depot_tools/third_party/logilab/common/corbautils.py +0 -117
  378. data/vendor/depot_tools/third_party/logilab/common/daemon.py +0 -101
  379. data/vendor/depot_tools/third_party/logilab/common/date.py +0 -335
  380. data/vendor/depot_tools/third_party/logilab/common/dbf.py +0 -231
  381. data/vendor/depot_tools/third_party/logilab/common/debugger.py +0 -214
  382. data/vendor/depot_tools/third_party/logilab/common/decorators.py +0 -281
  383. data/vendor/depot_tools/third_party/logilab/common/deprecation.py +0 -189
  384. data/vendor/depot_tools/third_party/logilab/common/fileutils.py +0 -404
  385. data/vendor/depot_tools/third_party/logilab/common/interface.py +0 -71
  386. data/vendor/depot_tools/third_party/logilab/common/logging_ext.py +0 -195
  387. data/vendor/depot_tools/third_party/logilab/common/modutils.py +0 -702
  388. data/vendor/depot_tools/third_party/logilab/common/optik_ext.py +0 -392
  389. data/vendor/depot_tools/third_party/logilab/common/optparser.py +0 -92
  390. data/vendor/depot_tools/third_party/logilab/common/proc.py +0 -277
  391. data/vendor/depot_tools/third_party/logilab/common/pyro_ext.py +0 -180
  392. data/vendor/depot_tools/third_party/logilab/common/pytest.py +0 -1199
  393. data/vendor/depot_tools/third_party/logilab/common/registry.py +0 -1119
  394. data/vendor/depot_tools/third_party/logilab/common/shellutils.py +0 -462
  395. data/vendor/depot_tools/third_party/logilab/common/sphinx_ext.py +0 -87
  396. data/vendor/depot_tools/third_party/logilab/common/sphinxutils.py +0 -122
  397. data/vendor/depot_tools/third_party/logilab/common/table.py +0 -929
  398. data/vendor/depot_tools/third_party/logilab/common/tasksqueue.py +0 -101
  399. data/vendor/depot_tools/third_party/logilab/common/testlib.py +0 -1392
  400. data/vendor/depot_tools/third_party/logilab/common/textutils.py +0 -537
  401. data/vendor/depot_tools/third_party/logilab/common/tree.py +0 -369
  402. data/vendor/depot_tools/third_party/logilab/common/umessage.py +0 -194
  403. data/vendor/depot_tools/third_party/logilab/common/ureports/__init__.py +0 -172
  404. data/vendor/depot_tools/third_party/logilab/common/ureports/docbook_writer.py +0 -140
  405. data/vendor/depot_tools/third_party/logilab/common/urllib2ext.py +0 -89
  406. data/vendor/depot_tools/third_party/logilab/common/visitor.py +0 -109
  407. data/vendor/depot_tools/third_party/logilab/common/xmlrpcutils.py +0 -131
  408. data/vendor/depot_tools/third_party/logilab/common/xmlutils.py +0 -61
@@ -48,10 +48,14 @@ its output.
48
48
  """
49
49
  from __future__ import print_function
50
50
 
51
- import sys, os
51
+ import os
52
52
  import os.path as osp
53
+ import sys
53
54
  from subprocess import Popen, PIPE
54
55
 
56
+ import six
57
+
58
+
55
59
  def _get_env():
56
60
  '''Extracts the environment PYTHONPATH and appends the current sys.path to
57
61
  those.'''
@@ -154,12 +158,12 @@ def py_run(command_options='', return_std=False, stdout=None, stderr=None,
154
158
  else:
155
159
  stderr = sys.stderr
156
160
  # Call pylint in a subprocess
157
- p = Popen(command_line, shell=True, stdout=stdout, stderr=stderr,
158
- env=_get_env(), universal_newlines=True)
159
- p.wait()
161
+ process = Popen(command_line, shell=True, stdout=stdout, stderr=stderr,
162
+ env=_get_env(), universal_newlines=True)
163
+ proc_stdout, proc_stderr = process.communicate()
160
164
  # Return standard output and error
161
165
  if return_std:
162
- return (p.stdout, p.stderr)
166
+ return six.moves.StringIO(proc_stdout), six.moves.StringIO(proc_stderr)
163
167
 
164
168
 
165
169
  def Run():
@@ -0,0 +1,311 @@
1
+ """Pylint plugin for parameter documentation checking in Sphinx, Google or
2
+ Numpy style docstrings
3
+ """
4
+ from __future__ import print_function, division, absolute_import
5
+
6
+ import re
7
+
8
+ from pylint.interfaces import IAstroidChecker
9
+ from pylint.checkers import BaseChecker
10
+ from pylint.checkers.utils import node_frame_class
11
+
12
+
13
+ def space_indentation(s):
14
+ """The number of leading spaces in a string
15
+
16
+ :param str s: input string
17
+
18
+ :rtype: int
19
+ :return: number of leading spaces
20
+ """
21
+ return len(s) - len(s.lstrip(' '))
22
+
23
+
24
+ class ParamDocChecker(BaseChecker):
25
+ """Checker for parameter documentation in Sphinx, Google or Numpy style
26
+ docstrings
27
+
28
+ * Check that all function, method and constructor parameters are mentioned
29
+ in the params and types part of the docstring. By convention,
30
+ constructor parameters are documented in the class docstring.
31
+ * Check that there are no naming inconsistencies between the signature and
32
+ the documentation, i.e. also report documented parameters that are missing
33
+ in the signature. This is important to find cases where parameters are
34
+ renamed only in the code, not in the documentation.
35
+
36
+ Activate this checker by adding the line::
37
+
38
+ load-plugins=pylint.extensions.check_docs
39
+
40
+ to the ``MASTER`` section of your ``.pylintrc``.
41
+
42
+ :param linter: linter object
43
+ :type linter: :class:`pylint.lint.PyLinter`
44
+ """
45
+ __implements__ = IAstroidChecker
46
+
47
+ name = 'param_checks'
48
+ msgs = {
49
+ 'W9003': ('"%s" missing or differing in parameter documentation',
50
+ 'missing-param-doc',
51
+ 'Please add parameter declarations for all parameters.'),
52
+ 'W9004': ('"%s" missing or differing in parameter type documentation',
53
+ 'missing-type-doc',
54
+ 'Please add parameter type declarations for all parameters.'),
55
+ }
56
+
57
+ options = (('accept-no-param-doc',
58
+ {'default': True, 'type' : 'yn', 'metavar' : '<y or n>',
59
+ 'help': 'Whether to accept totally missing parameter '
60
+ 'documentation in a docstring of a function that has '
61
+ 'parameters'
62
+ }),
63
+ )
64
+
65
+ priority = -2
66
+
67
+ def __init__(self, linter=None):
68
+ BaseChecker.__init__(self, linter)
69
+
70
+ constructor_names = set(["__init__", "__new__"])
71
+
72
+ def visit_functiondef(self, node):
73
+ """Called for function and method definitions (def).
74
+
75
+ :param node: Node for a function or method definition in the AST
76
+ :type node: :class:`astroid.scoped_nodes.Function`
77
+ """
78
+ if node.name in self.constructor_names:
79
+ class_node = node_frame_class(node)
80
+ if class_node is not None:
81
+ self.check_arguments_in_docstring(
82
+ class_node.doc, node.args, class_node)
83
+ return
84
+ self.check_arguments_in_docstring(node.doc, node.args, node)
85
+
86
+ re_for_parameters_see = re.compile(r"""
87
+ For\s+the\s+(other)?\s*parameters\s*,\s+see
88
+ """, re.X | re.S)
89
+
90
+ re_sphinx_param_in_docstring = re.compile(r"""
91
+ :param # Sphinx keyword
92
+ \s+ # whitespace
93
+
94
+ (?: # optional type declaration
95
+ (\w+)
96
+ \s+
97
+ )?
98
+
99
+ (\w+) # Parameter name
100
+ \s* # whitespace
101
+ : # final colon
102
+ """, re.X | re.S)
103
+
104
+ re_sphinx_type_in_docstring = re.compile(r"""
105
+ :type # Sphinx keyword
106
+ \s+ # whitespace
107
+ (\w+) # Parameter name
108
+ \s* # whitespace
109
+ : # final colon
110
+ """, re.X | re.S)
111
+
112
+ re_google_param_section = re.compile(r"""
113
+ ^([ ]*) Args \s*: \s*?$ # Google parameter header
114
+ ( .* ) # section
115
+ """, re.X | re.S | re.M)
116
+
117
+ re_google_param_line = re.compile(r"""
118
+ \s* (\w+) # identifier
119
+ \s* ( [(] .*? [)] )? \s* : # optional type declaration
120
+ \s* ( \w+ )? # beginning of optional description
121
+ """, re.X)
122
+
123
+ re_numpy_param_section = re.compile(r"""
124
+ ^([ ]*) Parameters \s*?$ # Numpy parameters header
125
+ \s* [-=]+ \s*?$ # underline
126
+ ( .* ) # section
127
+ """, re.X | re.S | re.M)
128
+
129
+ re_numpy_param_line = re.compile(r"""
130
+ \s* (\w+) # identifier
131
+ \s* :
132
+ \s* ( \w+ )? # optional type declaration
133
+ """, re.X)
134
+
135
+ not_needed_param_in_docstring = set(['self', 'cls'])
136
+
137
+ def check_arguments_in_docstring(self, doc, arguments_node, warning_node):
138
+ """Check that all parameters in a function, method or class constructor
139
+ on the one hand and the parameters mentioned in the parameter
140
+ documentation (e.g. the Sphinx tags 'param' and 'type') on the other
141
+ hand are consistent with each other.
142
+
143
+ * Undocumented parameters except 'self' are noticed.
144
+ * Undocumented parameter types except for 'self' and the ``*<args>``
145
+ and ``**<kwargs>`` parameters are noticed.
146
+ * Parameters mentioned in the parameter documentation that don't or no
147
+ longer exist in the function parameter list are noticed.
148
+ * If the text "For the parameters, see" or "For the other parameters,
149
+ see" (ignoring additional whitespace) is mentioned in the docstring,
150
+ missing parameter documentation is tolerated.
151
+ * If there's no Sphinx style, Google style or NumPy style parameter
152
+ documentation at all, i.e. ``:param`` is never mentioned etc., the
153
+ checker assumes that the parameters are documented in another format
154
+ and the absence is tolerated.
155
+
156
+ :param doc: Docstring for the function, method or class.
157
+ :type doc: str
158
+
159
+ :param arguments_node: Arguments node for the function, method or
160
+ class constructor.
161
+ :type arguments_node: :class:`astroid.scoped_nodes.Arguments`
162
+
163
+ :param warning_node: The node to assign the warnings to
164
+ :type warning_node: :class:`astroid.scoped_nodes.Node`
165
+ """
166
+ # Tolerate missing param or type declarations if there is a link to
167
+ # another method carrying the same name.
168
+ if doc is None:
169
+ return
170
+
171
+ doc = doc.expandtabs()
172
+
173
+ tolerate_missing_params = self.re_for_parameters_see.search(doc) is not None
174
+
175
+ # Collect the function arguments.
176
+ expected_argument_names = [arg.name for arg in arguments_node.args]
177
+ expected_argument_names += [arg.name for arg in arguments_node.kwonlyargs]
178
+ not_needed_type_in_docstring = (
179
+ self.not_needed_param_in_docstring.copy())
180
+
181
+ if arguments_node.vararg is not None:
182
+ expected_argument_names.append(arguments_node.vararg)
183
+ not_needed_type_in_docstring.add(arguments_node.vararg)
184
+ if arguments_node.kwarg is not None:
185
+ expected_argument_names.append(arguments_node.kwarg)
186
+ not_needed_type_in_docstring.add(arguments_node.kwarg)
187
+ params_with_doc, params_with_type = self.match_param_docs(doc)
188
+
189
+ # Tolerate no parameter documentation at all.
190
+ if (not params_with_doc and not params_with_type
191
+ and self.config.accept_no_param_doc):
192
+ tolerate_missing_params = True
193
+
194
+ def _compare_args(found_argument_names, message_id, not_needed_names):
195
+ """Compare the found argument names with the expected ones and
196
+ generate a message if there are inconsistencies.
197
+
198
+ :param list found_argument_names: argument names found in the
199
+ docstring
200
+
201
+ :param str message_id: pylint message id
202
+
203
+ :param not_needed_names: names that may be omitted
204
+ :type not_needed_names: set of str
205
+ """
206
+ if not tolerate_missing_params:
207
+ missing_or_differing_argument_names = (
208
+ (set(expected_argument_names) ^ set(found_argument_names))
209
+ - not_needed_names)
210
+ else:
211
+ missing_or_differing_argument_names = (
212
+ (set(found_argument_names) - set(expected_argument_names))
213
+ - not_needed_names)
214
+
215
+ if missing_or_differing_argument_names:
216
+ self.add_message(
217
+ message_id,
218
+ args=(', '.join(
219
+ sorted(missing_or_differing_argument_names)),),
220
+ node=warning_node)
221
+
222
+ _compare_args(params_with_doc, 'missing-param-doc',
223
+ self.not_needed_param_in_docstring)
224
+ _compare_args(params_with_type, 'missing-type-doc',
225
+ not_needed_type_in_docstring)
226
+
227
+ def match_param_docs(self, doc):
228
+ """Match parameter documentation in docstrings written in Sphinx, Google
229
+ or NumPy style
230
+
231
+ :param str doc: docstring
232
+
233
+ :return: tuple of lists of str: params_with_doc, params_with_type
234
+ """
235
+ params_with_doc = []
236
+ params_with_type = []
237
+
238
+ if self.re_sphinx_param_in_docstring.search(doc) is not None:
239
+ # Sphinx param declarations
240
+ for match in re.finditer(self.re_sphinx_param_in_docstring, doc):
241
+ name = match.group(2)
242
+ params_with_doc.append(name)
243
+ if match.group(1) is not None:
244
+ params_with_type.append(name)
245
+
246
+ # Sphinx type declarations
247
+ params_with_type += re.findall(
248
+ self.re_sphinx_type_in_docstring, doc)
249
+ else:
250
+ match = self.re_google_param_section.search(doc)
251
+ if match is not None:
252
+ is_google = True
253
+ re_line = self.re_google_param_line
254
+ else:
255
+ match = self.re_numpy_param_section.search(doc)
256
+ if match is not None:
257
+ is_google = False
258
+ re_line = self.re_numpy_param_line
259
+ else:
260
+ # some other documentation style
261
+ return [], []
262
+
263
+ min_indentation = len(match.group(1))
264
+ if is_google:
265
+ min_indentation += 1
266
+
267
+ prev_param_name = None
268
+ is_first = True
269
+ for line in match.group(2).splitlines():
270
+ if not line.strip():
271
+ continue
272
+ indentation = space_indentation(line)
273
+ if indentation < min_indentation:
274
+ break
275
+
276
+ # The first line after the header defines the minimum
277
+ # indentation.
278
+ if is_first:
279
+ min_indentation = indentation
280
+ is_first = False
281
+
282
+ if indentation > min_indentation:
283
+ # Lines with more than minimum indentation must contain a
284
+ # description.
285
+ if (not params_with_doc
286
+ or params_with_doc[-1] != prev_param_name):
287
+ assert prev_param_name is not None
288
+ params_with_doc.append(prev_param_name)
289
+ else:
290
+ # Lines with minimum indentation must contain the beginning
291
+ # of a new parameter documentation.
292
+ match = re_line.match(line)
293
+ if match is None:
294
+ break
295
+ prev_param_name = match.group(1)
296
+ if match.group(2) is not None:
297
+ params_with_type.append(prev_param_name)
298
+
299
+ if is_google and match.group(3) is not None:
300
+ params_with_doc.append(prev_param_name)
301
+
302
+ return params_with_doc, params_with_type
303
+
304
+
305
+ def register(linter):
306
+ """Required method to auto register this checker.
307
+
308
+ :param linter: Main interface object for Pylint plugins
309
+ :type linter: Pylint object
310
+ """
311
+ linter.register_checker(ParamDocChecker(linter))
@@ -0,0 +1,62 @@
1
+ import astroid
2
+ from pylint.checkers import BaseTokenChecker
3
+ from pylint.checkers.utils import check_messages
4
+ from pylint.interfaces import ITokenChecker, IAstroidChecker
5
+
6
+
7
+ class ElseifUsedChecker(BaseTokenChecker):
8
+ """Checks for use of "else if" when a "elif" could be used
9
+ """
10
+
11
+ __implements__ = (ITokenChecker, IAstroidChecker)
12
+ name = 'elseifused'
13
+ msgs = {'R5501': ('Consider using "elif" instead of "else if"',
14
+ 'else-if-used',
15
+ 'Used when an else statement is immediately followed by '
16
+ 'an if statement and does not contain statements that '
17
+ 'would be unrelated to it.'),
18
+ }
19
+
20
+ def __init__(self, linter=None):
21
+ BaseTokenChecker.__init__(self, linter)
22
+ self._init()
23
+
24
+ def _init(self):
25
+ self._elifs = []
26
+ self._if_counter = 0
27
+
28
+ def process_tokens(self, tokens):
29
+ # Process tokens and look for 'if' or 'elif'
30
+ for _, token, _, _, _ in tokens:
31
+ if token == 'elif':
32
+ self._elifs.append(True)
33
+ elif token == 'if':
34
+ self._elifs.append(False)
35
+
36
+ def leave_module(self, _):
37
+ self._init()
38
+
39
+ def visit_ifexp(self, _):
40
+ self._if_counter += 1
41
+
42
+ def visit_comprehension(self, node):
43
+ self._if_counter += len(node.ifs)
44
+
45
+ @check_messages('else-if-used')
46
+ def visit_if(self, node):
47
+ if isinstance(node.parent, astroid.If):
48
+ orelse = node.parent.orelse
49
+ # current if node must directly follow a "else"
50
+ if orelse and orelse == [node]:
51
+ if not self._elifs[self._if_counter]:
52
+ self.add_message('else-if-used', node=node)
53
+ self._if_counter += 1
54
+
55
+
56
+ def register(linter):
57
+ """Required method to auto register this checker.
58
+
59
+ :param linter: Main interface object for Pylint plugins
60
+ :type linter: Pylint object
61
+ """
62
+ linter.register_checker(ElseifUsedChecker(linter))
@@ -1,41 +1,29 @@
1
- # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
2
- # contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
3
- #
4
- # This file is part of logilab-common.
5
- #
6
- # logilab-common is free software: you can redistribute it and/or modify it under
7
- # the terms of the GNU Lesser General Public License as published by the Free
8
- # Software Foundation, either version 2.1 of the License, or (at your option) any
9
- # later version.
1
+ # Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE).
2
+ # This program is free software; you can redistribute it and/or modify it under
3
+ # the terms of the GNU General Public License as published by the Free Software
4
+ # Foundation; either version 2 of the License, or (at your option) any later
5
+ # version.
10
6
  #
11
- # logilab-common is distributed in the hope that it will be useful, but WITHOUT
7
+ # This program is distributed in the hope that it will be useful, but WITHOUT
12
8
  # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
- # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
14
- # details.
9
+ # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details
15
10
  #
16
- # You should have received a copy of the GNU Lesser General Public License along
17
- # with logilab-common. If not, see <http://www.gnu.org/licenses/>.
11
+ # You should have received a copy of the GNU General Public License along with
12
+ # this program; if not, write to the Free Software Foundation, Inc.,
13
+ # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
14
+
15
+ # This file was copied from logilab-common with the same license:
16
+ # copyright 2003-2011 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
18
17
  """Graph manipulation utilities.
19
18
 
20
19
  (dot generation adapted from pypy/translator/tool/make_dot.py)
21
20
  """
22
21
 
23
- __docformat__ = "restructuredtext en"
24
-
25
- __metaclass__ = type
26
-
27
22
  import os.path as osp
28
23
  import os
29
24
  import sys
30
25
  import tempfile
31
26
  import codecs
32
- import errno
33
-
34
- def escape(value):
35
- """Make <value> usable in a dot file."""
36
- lines = [line.replace('"', '\\"') for line in value.split('\n')]
37
- data = '\\l'.join(lines)
38
- return '\\n' + data
39
27
 
40
28
  def target_info_from_filename(filename):
41
29
  """Transforms /some/path/foo.png into ('/some/path', 'foo.png', 'png')."""
@@ -45,10 +33,12 @@ def target_info_from_filename(filename):
45
33
  return storedir, basename, target
46
34
 
47
35
 
48
- class DotBackend:
36
+ class DotBackend(object):
49
37
  """Dot File backend."""
50
38
  def __init__(self, graphname, rankdir=None, size=None, ratio=None,
51
- charset='utf-8', renderer='dot', additionnal_param={}):
39
+ charset='utf-8', renderer='dot', additional_param=None):
40
+ if additional_param is None:
41
+ additional_param = {}
52
42
  self.graphname = graphname
53
43
  self.renderer = renderer
54
44
  self.lines = []
@@ -64,7 +54,7 @@ class DotBackend:
64
54
  assert charset.lower() in ('utf-8', 'iso-8859-1', 'latin1'), \
65
55
  'unsupported charset %s' % charset
66
56
  self.emit('charset="%s"' % charset)
67
- for param in sorted(additionnal_param.items()):
57
+ for param in additional_param.items():
68
58
  self.emit('='.join(param))
69
59
 
70
60
  def get_source(self):
@@ -95,7 +85,7 @@ class DotBackend:
95
85
  else:
96
86
  dotfile = '%s.dot' % name
97
87
  if outputfile is not None:
98
- storedir, basename, target = target_info_from_filename(outputfile)
88
+ storedir, _, target = target_info_from_filename(outputfile)
99
89
  if target != "dot":
100
90
  pdot, dot_sourcepath = tempfile.mkstemp(".dot", name)
101
91
  os.close(pdot)
@@ -111,22 +101,16 @@ class DotBackend:
111
101
  pdot.write(self.source)
112
102
  pdot.close()
113
103
  if target != 'dot':
114
- if sys.platform == 'win32':
115
- use_shell = True
104
+ use_shell = sys.platform == 'win32'
105
+ if mapfile:
106
+ subprocess.call([self.renderer, '-Tcmapx', '-o',
107
+ mapfile, '-T', target, dot_sourcepath,
108
+ '-o', outputfile],
109
+ shell=use_shell)
116
110
  else:
117
- use_shell = False
118
- try:
119
- if mapfile:
120
- subprocess.call([self.renderer, '-Tcmapx', '-o', mapfile, '-T', target, dot_sourcepath, '-o', outputfile],
121
- shell=use_shell)
122
- else:
123
- subprocess.call([self.renderer, '-T', target,
124
- dot_sourcepath, '-o', outputfile],
125
- shell=use_shell)
126
- except OSError as e:
127
- if e.errno == errno.ENOENT:
128
- e.strerror = 'File not found: {0}'.format(self.renderer)
129
- raise
111
+ subprocess.call([self.renderer, '-T', target,
112
+ dot_sourcepath, '-o', outputfile],
113
+ shell=use_shell)
130
114
  os.unlink(dot_sourcepath)
131
115
  return outputfile
132
116
 
@@ -140,7 +124,7 @@ class DotBackend:
140
124
  """
141
125
  attrs = ['%s="%s"' % (prop, value) for prop, value in props.items()]
142
126
  n_from, n_to = normalize_node_id(name1), normalize_node_id(name2)
143
- self.emit('%s -> %s [%s];' % (n_from, n_to, ', '.join(sorted(attrs))) )
127
+ self.emit('%s -> %s [%s];' % (n_from, n_to, ', '.join(sorted(attrs))))
144
128
 
145
129
  def emit_node(self, name, **props):
146
130
  """emit a node with given properties.
@@ -153,74 +137,6 @@ def normalize_node_id(nid):
153
137
  """Returns a suitable DOT node id for `nid`."""
154
138
  return '"%s"' % nid
155
139
 
156
- class GraphGenerator:
157
- def __init__(self, backend):
158
- # the backend is responsible to output the graph in a particular format
159
- self.backend = backend
160
-
161
- # XXX doesn't like space in outpufile / mapfile
162
- def generate(self, visitor, propshdlr, outputfile=None, mapfile=None):
163
- # the visitor
164
- # the property handler is used to get node and edge properties
165
- # according to the graph and to the backend
166
- self.propshdlr = propshdlr
167
- for nodeid, node in visitor.nodes():
168
- props = propshdlr.node_properties(node)
169
- self.backend.emit_node(nodeid, **props)
170
- for subjnode, objnode, edge in visitor.edges():
171
- props = propshdlr.edge_properties(edge, subjnode, objnode)
172
- self.backend.emit_edge(subjnode, objnode, **props)
173
- return self.backend.generate(outputfile=outputfile, mapfile=mapfile)
174
-
175
-
176
- class UnorderableGraph(Exception):
177
- pass
178
-
179
- def ordered_nodes(graph):
180
- """takes a dependency graph dict as arguments and return an ordered tuple of
181
- nodes starting with nodes without dependencies and up to the outermost node.
182
-
183
- If there is some cycle in the graph, :exc:`UnorderableGraph` will be raised.
184
-
185
- Also the given graph dict will be emptied.
186
- """
187
- # check graph consistency
188
- cycles = get_cycles(graph)
189
- if cycles:
190
- cycles = '\n'.join([' -> '.join(cycle) for cycle in cycles])
191
- raise UnorderableGraph('cycles in graph: %s' % cycles)
192
- vertices = set(graph)
193
- to_vertices = set()
194
- for edges in graph.values():
195
- to_vertices |= set(edges)
196
- missing_vertices = to_vertices - vertices
197
- if missing_vertices:
198
- raise UnorderableGraph('missing vertices: %s' % ', '.join(missing_vertices))
199
- # order vertices
200
- order = []
201
- order_set = set()
202
- old_len = None
203
- while graph:
204
- if old_len == len(graph):
205
- raise UnorderableGraph('unknown problem with %s' % graph)
206
- old_len = len(graph)
207
- deps_ok = []
208
- for node, node_deps in graph.items():
209
- for dep in node_deps:
210
- if dep not in order_set:
211
- break
212
- else:
213
- deps_ok.append(node)
214
- order.append(deps_ok)
215
- order_set |= set(deps_ok)
216
- for node in deps_ok:
217
- del graph[node]
218
- result = []
219
- for grp in reversed(order):
220
- result.extend(sorted(grp))
221
- return tuple(result)
222
-
223
-
224
140
  def get_cycles(graph_dict, vertices=None):
225
141
  '''given a dictionary representing an ordered graph (i.e. key are vertices
226
142
  and values is a list of destination vertices representing edges), return a
@@ -248,7 +164,7 @@ def _get_cycles(graph_dict, path, visited, result, vertice):
248
164
  index = cycle.index(start_from)
249
165
  cycle = cycle[index:] + cycle[0:index]
250
166
  # append it to result if not already in
251
- if not cycle in result:
167
+ if cycle not in result:
252
168
  result.append(cycle)
253
169
  return
254
170
  path.append(vertice)
@@ -261,22 +177,3 @@ def _get_cycles(graph_dict, path, visited, result, vertice):
261
177
  except KeyError:
262
178
  pass
263
179
  path.pop()
264
-
265
- def has_path(graph_dict, fromnode, tonode, path=None):
266
- """generic function taking a simple graph definition as a dictionary, with
267
- node has key associated to a list of nodes directly reachable from it.
268
-
269
- Return None if no path exists to go from `fromnode` to `tonode`, else the
270
- first path found (as a list including the destination node at last)
271
- """
272
- if path is None:
273
- path = []
274
- elif fromnode in path:
275
- return None
276
- path.append(fromnode)
277
- for destnode in graph_dict[fromnode]:
278
- if destnode == tonode or has_path(graph_dict, destnode, tonode, path):
279
- return path[1:] + [tonode]
280
- path.pop()
281
- return None
282
-