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.
- checksums.yaml +4 -4
- data/.travis.yml +3 -0
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/ext/libv8/builder.rb +6 -2
- data/lib/libv8/version.rb +1 -1
- data/vendor/depot_tools/.gitattributes +1 -0
- data/vendor/depot_tools/.gitignore +7 -0
- data/vendor/depot_tools/CROS_OWNERS +5 -0
- data/vendor/depot_tools/OWNERS +12 -1
- data/vendor/depot_tools/PRESUBMIT.py +16 -9
- data/vendor/depot_tools/README.md +9 -2
- data/vendor/depot_tools/autoninja +14 -6
- data/vendor/depot_tools/autoninja.bat +11 -1
- data/vendor/depot_tools/autoninja.py +40 -18
- data/vendor/depot_tools/bb +12 -0
- data/vendor/depot_tools/bb.bat +7 -0
- data/vendor/depot_tools/bootstrap/win/manifest.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/manifest_bleeding_edge.txt +1 -1
- data/vendor/depot_tools/bootstrap/win/win_tools.py +2 -1
- data/vendor/depot_tools/buildbucket.py +57 -4
- data/vendor/depot_tools/cipd +157 -44
- data/vendor/depot_tools/cipd.bat +51 -14
- data/vendor/depot_tools/cipd.ps1 +104 -42
- data/vendor/depot_tools/cipd_client_version +1 -1
- data/vendor/depot_tools/cipd_client_version.digests +21 -0
- data/vendor/depot_tools/cipd_manifest.txt +19 -6
- data/vendor/depot_tools/cipd_manifest.versions +318 -0
- data/vendor/depot_tools/clang_format.py +4 -4
- data/vendor/depot_tools/cpplint.py +44 -199
- data/vendor/depot_tools/dart_format.py +2 -2
- data/vendor/depot_tools/detect_host_arch.py +8 -3
- data/vendor/depot_tools/download_from_google_storage.py +47 -39
- data/vendor/depot_tools/fetch.py +30 -18
- data/vendor/depot_tools/fetch_configs/android_internal.py +34 -0
- data/vendor/depot_tools/fetch_configs/chromium.py +18 -1
- data/vendor/depot_tools/fetch_configs/config_util.py +4 -2
- data/vendor/depot_tools/fetch_configs/inspector_protocol.py +40 -0
- data/vendor/depot_tools/fetch_configs/node-ci.py +41 -0
- data/vendor/depot_tools/fix_encoding.py +3 -3
- data/vendor/depot_tools/gclient +1 -1
- data/vendor/depot_tools/gclient.py +415 -198
- data/vendor/depot_tools/gclient_eval.py +220 -171
- data/vendor/depot_tools/gclient_paths.py +142 -0
- data/vendor/depot_tools/gclient_scm.py +200 -51
- data/vendor/depot_tools/gclient_utils.py +88 -191
- data/vendor/depot_tools/gerrit_client.py +13 -0
- data/vendor/depot_tools/gerrit_util.py +158 -23
- data/vendor/depot_tools/git-nav-upstream +1 -1
- data/vendor/depot_tools/git_cache.py +77 -24
- data/vendor/depot_tools/git_cl.py +705 -1099
- data/vendor/depot_tools/git_common.py +9 -6
- data/vendor/depot_tools/git_map_branches.py +19 -2
- data/vendor/depot_tools/git_nav_downstream.py +3 -4
- data/vendor/depot_tools/git_rebase_update.py +14 -0
- data/vendor/depot_tools/git_reparent_branch.py +8 -2
- data/vendor/depot_tools/gn.py +38 -3
- data/vendor/depot_tools/gsutil.py +8 -3
- data/vendor/depot_tools/gsutil.py.bat +15 -0
- data/vendor/depot_tools/gsutil.vpython +16 -0
- data/vendor/depot_tools/infra/config/OWNERS +0 -1
- data/vendor/depot_tools/infra/config/recipes.cfg +3 -2
- data/vendor/depot_tools/lucicfg +12 -0
- data/vendor/depot_tools/lucicfg.bat +7 -0
- data/vendor/depot_tools/man/html/git-map-branches.html +34 -2
- data/vendor/depot_tools/man/html/git-new-branch.html +40 -32
- data/vendor/depot_tools/man/man1/git-map-branches.1 +24 -5
- data/vendor/depot_tools/man/man1/git-new-branch.1 +35 -27
- data/vendor/depot_tools/man/src/git-map-branches.demo.1.sh +1 -0
- data/vendor/depot_tools/man/src/git-map-branches.txt +10 -0
- data/vendor/depot_tools/man/src/git-new-branch.demo.1.sh +9 -4
- data/vendor/depot_tools/man/src/git-new-branch.txt +1 -1
- data/vendor/depot_tools/metrics.README.md +98 -0
- data/vendor/depot_tools/metrics.py +296 -0
- data/vendor/depot_tools/metrics_utils.py +303 -0
- data/vendor/depot_tools/my_activity.py +91 -29
- data/vendor/depot_tools/ninja +1 -1
- data/vendor/depot_tools/ninjalog.README.md +64 -0
- data/vendor/depot_tools/ninjalog_uploader.py +232 -0
- data/vendor/depot_tools/ninjalog_uploader_wrapper.py +116 -0
- data/vendor/depot_tools/owners.py +30 -13
- data/vendor/depot_tools/owners_finder.py +5 -2
- data/vendor/depot_tools/presubmit_canned_checks.py +188 -29
- data/vendor/depot_tools/presubmit_support.py +18 -41
- data/vendor/depot_tools/pylintrc +23 -19
- data/vendor/depot_tools/recipes/OWNERS +2 -0
- data/vendor/depot_tools/recipes/README.recipes.md +344 -151
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/OWNERS +2 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/__init__.py +2 -16
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/api.py +141 -99
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic.json +5 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_luci.json +5 -8
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/basic_with_branch_heads.json +6 -98
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/clobber.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/deprecated_got_revision_mapping.json +45 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_rebase_patch_ref.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/gerrit_no_reset.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{tryjob.json → input_commit_with_id_without_repo.json} +6 -11
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{tryjob_empty_revision.json → multiple_patch_refs.json} +8 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/no_apply_patch_on_gclient.json +19 -29
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/{trychange.json → refs.json} +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/reset_root_solution_revision.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail.json +51 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch.json +50 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_fail_patch_download.json +51 -6
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle.json +17 -25
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_branch_heads.json +17 -25
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_feature_branch.json +18 -26
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8_feature_branch.json +18 -26
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_webrtc.json +26 -28
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8.json +45 -5
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_v8_head_by_default.json +17 -25
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/unrecognized_commit_repo.json +13 -0
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name.json +13 -152
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_tags.json +4 -9
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.py +185 -202
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/bot_update.py +52 -157
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/test_api.py +5 -14
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/tests/ensure_checkout.py +34 -0
- data/vendor/depot_tools/recipes/recipe_modules/cipd/api.py +14 -2
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/basic_pkg.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-failed.json +7 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/describe-many-instances.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/mac64.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_file.json +9 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_mode.json +9 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/pkg_bad_verfile.json +9 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/full.expected/win64.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk arch.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/junk bits.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_32.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_arm_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_32.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_intel_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/linux_mips_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/mac_intel_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_32.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/cipd/examples/platform_suffix.expected/win_intel_64.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/api.py +13 -8
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic.json +18 -12
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/basic_luci.json +18 -12
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.expected/win.json +18 -12
- data/vendor/depot_tools/recipes/recipe_modules/depot_tools/examples/full.py +3 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/gclient/api.py +58 -46
- data/vendor/depot_tools/recipes/recipe_modules/gclient/config.py +65 -22
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/basic.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/buildbot.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/revision.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.expected/tryserver.json +20 -21
- data/vendor/depot_tools/recipes/recipe_modules/gclient/examples/full.py +5 -2
- data/vendor/depot_tools/recipes/recipe_modules/gclient/tests/patch_project.py +62 -14
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/api.py +24 -38
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.expected/basic.json +56 -50
- data/vendor/depot_tools/recipes/recipe_modules/gerrit/examples/full.py +15 -9
- data/vendor/depot_tools/recipes/recipe_modules/git/__init__.py +4 -1
- data/vendor/depot_tools/recipes/recipe_modules/git/api.py +34 -22
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_branch.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_file_name.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_hash.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_luci.json +222 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_ref.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_submodule_update_force.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/basic_tags.json +224 -0
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/can_fail_build.json +10 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cannot_fail_build.json +5 -7
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/cat-file_test.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_delta.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_failed.json +5 -7
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/count-objects_with_bad_output_fails_build.json +10 -5
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/curl_trace_file.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/git-cache-checkout.json +8 -9
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/platform_win.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/rebase_failed.json +12 -8
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/remote_not_origin.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.expected/set_got_revision.json +5 -6
- data/vendor/depot_tools/recipes/recipe_modules/git/examples/full.py +27 -11
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/api.py +1 -1
- data/vendor/depot_tools/recipes/recipe_modules/git_cl/examples/full.expected/basic.json +12 -13
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/__init__.py +5 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/api.py +120 -5
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.expected/basic.json +45 -3
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/examples/full.py +25 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/resources/gerrit_client.py +56 -4
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.expected/basic.json +6 -0
- data/vendor/depot_tools/recipes/recipe_modules/gitiles/tests/parse_repo_url.py +49 -0
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/api.py +24 -13
- data/vendor/depot_tools/recipes/recipe_modules/gsutil/examples/full.expected/basic.json +13 -14
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/basic.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_linux.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_mac.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_buildbot_win.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_linux.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_mac.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_generic_win.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_linux.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_mac.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/examples/full.expected/paths_kitchen_win.json +2 -3
- data/vendor/depot_tools/recipes/recipe_modules/infra_paths/path_config.py +1 -2
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/__init__.py +35 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/api.py +116 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/linux.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/mac.json +82 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.expected/win.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/osx_sdk/examples/full.py +23 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/api.py +2 -7
- data/vendor/depot_tools/recipes/recipe_modules/presubmit/examples/full.expected/basic.json +7 -6
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/__init__.py +1 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/api.py +117 -8
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/basic_tags.json +4 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/set_failure_hash_with_no_steps.json +7 -4
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch.json +98 -7
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_gerrit_patch_and_target_ref.json +147 -0
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch.json +8 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_git_patch_luci.json +8 -5
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch.json +9 -6
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.expected/with_wrong_patch_new.json +9 -6
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/examples/full.py +27 -2
- data/vendor/depot_tools/recipes/recipe_modules/tryserver/test_api.py +14 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/__init__.py +25 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/api.py +137 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/linux.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/mac.json +22 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.expected/win.json +107 -0
- data/vendor/depot_tools/recipes/recipe_modules/windows_sdk/examples/full.py +26 -0
- data/vendor/depot_tools/recipes/recipes.py +37 -27
- data/vendor/depot_tools/recipes/recipes/fetch_end_to_end_test.expected/basic.json +7 -10
- data/vendor/depot_tools/repo +34 -8
- data/vendor/depot_tools/roll_dep.py +52 -49
- data/vendor/depot_tools/scm.py +38 -23
- data/vendor/depot_tools/setup_color.py +4 -2
- data/vendor/depot_tools/split_cl.py +32 -4
- data/vendor/depot_tools/subprocess2.py +22 -4
- data/vendor/depot_tools/third_party/httplib2/README.chromium +2 -2
- data/vendor/depot_tools/third_party/httplib2/__init__.py +242 -158
- data/vendor/depot_tools/third_party/httplib2/cacerts.txt +57 -44
- data/vendor/depot_tools/third_party/httplib2/socks.py +15 -5
- data/vendor/depot_tools/third_party/logilab/README.chromium +2 -4
- data/vendor/depot_tools/third_party/logilab/astroid/README.chromium +2 -1
- data/vendor/depot_tools/third_party/logilab/astroid/__init__.py +10 -5
- data/vendor/depot_tools/third_party/logilab/astroid/__pkginfo__.py +5 -5
- data/vendor/depot_tools/third_party/logilab/astroid/arguments.py +233 -0
- data/vendor/depot_tools/third_party/logilab/astroid/as_string.py +82 -33
- data/vendor/depot_tools/third_party/logilab/astroid/bases.py +137 -153
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{builtin_inference.py → brain_builtin_inference.py} +117 -26
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_dateutil.py +15 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{py2gi.py → brain_gi.py} +48 -8
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{py2mechanize.py → brain_mechanize.py} +0 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{pynose.py → brain_nose.py} +4 -1
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_numpy.py +62 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_pytest.py +76 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_qt.py +44 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/{pysix_moves.py → brain_six.py} +28 -1
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_ssl.py +65 -0
- data/vendor/depot_tools/third_party/logilab/astroid/brain/brain_stdlib.py +473 -0
- data/vendor/depot_tools/third_party/logilab/astroid/builder.py +104 -81
- data/vendor/depot_tools/third_party/logilab/astroid/context.py +81 -0
- data/vendor/depot_tools/third_party/logilab/astroid/decorators.py +75 -0
- data/vendor/depot_tools/third_party/logilab/astroid/exceptions.py +20 -0
- data/vendor/depot_tools/third_party/logilab/astroid/inference.py +137 -183
- data/vendor/depot_tools/third_party/logilab/astroid/manager.py +45 -169
- data/vendor/depot_tools/third_party/logilab/astroid/mixins.py +37 -14
- data/vendor/depot_tools/third_party/logilab/astroid/modutils.py +112 -41
- data/vendor/depot_tools/third_party/logilab/astroid/node_classes.py +243 -156
- data/vendor/depot_tools/third_party/logilab/astroid/nodes.py +35 -22
- data/vendor/depot_tools/third_party/logilab/astroid/objects.py +186 -0
- data/vendor/depot_tools/third_party/logilab/astroid/protocols.py +157 -102
- data/vendor/depot_tools/third_party/logilab/astroid/raw_building.py +32 -8
- data/vendor/depot_tools/third_party/logilab/astroid/rebuilder.py +372 -309
- data/vendor/depot_tools/third_party/logilab/astroid/scoped_nodes.py +652 -420
- data/vendor/depot_tools/third_party/logilab/astroid/test_utils.py +4 -21
- data/vendor/depot_tools/third_party/logilab/astroid/transforms.py +96 -0
- data/vendor/depot_tools/third_party/logilab/astroid/util.py +89 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/LICENSE +19 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/README.chromium +11 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/__init__.py +20 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/cext.c +1421 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/compat.py +9 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/simple.py +246 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/slots.py +414 -0
- data/vendor/depot_tools/third_party/logilab/lazy_object_proxy/utils.py +13 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/LICENSE +24 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/README.chromium +11 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/__init__.py +19 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/_wrappers.c +2729 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/arguments.py +96 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/decorators.py +512 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/importer.py +228 -0
- data/vendor/depot_tools/third_party/logilab/wrapt/wrappers.py +901 -0
- data/vendor/depot_tools/third_party/pylint/README.chromium +2 -25
- data/vendor/depot_tools/third_party/pylint/__pkginfo__.py +13 -3
- data/vendor/depot_tools/third_party/pylint/checkers/__init__.py +1 -2
- data/vendor/depot_tools/third_party/pylint/checkers/async.py +82 -0
- data/vendor/depot_tools/third_party/pylint/checkers/base.py +893 -119
- data/vendor/depot_tools/third_party/pylint/checkers/classes.py +342 -204
- data/vendor/depot_tools/third_party/pylint/checkers/design_analysis.py +51 -34
- data/vendor/depot_tools/third_party/pylint/checkers/exceptions.py +84 -47
- data/vendor/depot_tools/third_party/pylint/checkers/format.py +55 -30
- data/vendor/depot_tools/third_party/pylint/checkers/imports.py +314 -73
- data/vendor/depot_tools/third_party/pylint/checkers/logging.py +10 -8
- data/vendor/depot_tools/third_party/pylint/checkers/misc.py +2 -1
- data/vendor/depot_tools/third_party/pylint/checkers/newstyle.py +45 -48
- data/vendor/depot_tools/third_party/pylint/checkers/python3.py +31 -21
- data/vendor/depot_tools/third_party/pylint/checkers/raw_metrics.py +3 -3
- data/vendor/depot_tools/third_party/pylint/checkers/similar.py +4 -5
- data/vendor/depot_tools/third_party/pylint/checkers/spelling.py +24 -10
- data/vendor/depot_tools/third_party/pylint/checkers/stdlib.py +120 -56
- data/vendor/depot_tools/third_party/pylint/checkers/strings.py +38 -35
- data/vendor/depot_tools/third_party/pylint/checkers/typecheck.py +485 -138
- data/vendor/depot_tools/third_party/pylint/checkers/utils.py +319 -142
- data/vendor/depot_tools/third_party/pylint/checkers/variables.py +329 -207
- data/vendor/depot_tools/third_party/pylint/config.py +739 -76
- data/vendor/depot_tools/third_party/pylint/epylint.py +9 -5
- data/vendor/depot_tools/third_party/pylint/extensions/__init__.py +0 -0
- data/vendor/depot_tools/third_party/pylint/extensions/check_docs.py +311 -0
- data/vendor/depot_tools/third_party/pylint/extensions/check_elif.py +62 -0
- data/vendor/depot_tools/third_party/{logilab/common → pylint}/graph.py +30 -133
- data/vendor/depot_tools/third_party/pylint/gui.py +2 -2
- data/vendor/depot_tools/third_party/pylint/interfaces.py +21 -3
- data/vendor/depot_tools/third_party/pylint/lint.py +123 -140
- data/vendor/depot_tools/third_party/pylint/pyreverse/diadefslib.py +10 -13
- data/vendor/depot_tools/third_party/pylint/pyreverse/diagrams.py +15 -4
- data/vendor/depot_tools/third_party/pylint/pyreverse/inspector.py +372 -0
- data/vendor/depot_tools/third_party/pylint/pyreverse/main.py +30 -7
- data/vendor/depot_tools/third_party/pylint/pyreverse/utils.py +80 -2
- data/vendor/depot_tools/third_party/{logilab/common → pylint/pyreverse}/vcgutils.py +19 -37
- data/vendor/depot_tools/third_party/pylint/pyreverse/writer.py +3 -4
- data/vendor/depot_tools/third_party/pylint/reporters/__init__.py +34 -18
- data/vendor/depot_tools/third_party/pylint/reporters/guireporter.py +1 -1
- data/vendor/depot_tools/third_party/pylint/reporters/html.py +10 -3
- data/vendor/depot_tools/third_party/pylint/reporters/json.py +10 -4
- data/vendor/depot_tools/third_party/pylint/reporters/text.py +94 -3
- data/vendor/depot_tools/third_party/pylint/reporters/ureports/__init__.py +106 -0
- data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/html_writer.py +17 -57
- data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/nodes.py +52 -74
- data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/text_writer.py +14 -60
- data/vendor/depot_tools/third_party/pylint/testutils.py +22 -20
- data/vendor/depot_tools/third_party/pylint/utils.py +268 -44
- data/vendor/depot_tools/third_party/repo/progress.py +42 -0
- data/vendor/depot_tools/update_depot_tools +1 -1
- data/vendor/depot_tools/upload_metrics.py +25 -0
- data/vendor/depot_tools/win_toolchain/get_toolchain_if_necessary.py +45 -15
- data/vendor/depot_tools/win_toolchain/package_from_installed.py +71 -24
- data/vendor/depot_tools/yapf +1 -1
- data/vendor/depot_tools/yapf.bat +1 -1
- metadata +92 -77
- data/vendor/depot_tools/git-crsync +0 -3
- data/vendor/depot_tools/infra/config/cq.cfg +0 -32
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref.json +0 -29
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/apply_gerrit_ref_custom.json +0 -29
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/buildbot.json +0 -105
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/shallow.json +0 -195
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_angle_deprecated.json +0 -248
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/tryjob_gerrit_v8.json +0 -248
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/examples/full.expected/with_manifest_name_no_patch.json +0 -105
- data/vendor/depot_tools/recipes/recipe_modules/bot_update/resources/apply_gerrit.py +0 -33
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2pytest.py +0 -31
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2qt4.py +0 -22
- data/vendor/depot_tools/third_party/logilab/astroid/brain/py2stdlib.py +0 -334
- data/vendor/depot_tools/third_party/logilab/astroid/inspector.py +0 -273
- data/vendor/depot_tools/third_party/logilab/astroid/utils.py +0 -239
- data/vendor/depot_tools/third_party/logilab/common/LICENSE.txt +0 -339
- data/vendor/depot_tools/third_party/logilab/common/README.chromium +0 -11
- data/vendor/depot_tools/third_party/logilab/common/__init__.py +0 -175
- data/vendor/depot_tools/third_party/logilab/common/__pkginfo__.py +0 -57
- data/vendor/depot_tools/third_party/logilab/common/cache.py +0 -114
- data/vendor/depot_tools/third_party/logilab/common/changelog.py +0 -238
- data/vendor/depot_tools/third_party/logilab/common/clcommands.py +0 -334
- data/vendor/depot_tools/third_party/logilab/common/cli.py +0 -211
- data/vendor/depot_tools/third_party/logilab/common/compat.py +0 -78
- data/vendor/depot_tools/third_party/logilab/common/configuration.py +0 -1105
- data/vendor/depot_tools/third_party/logilab/common/contexts.py +0 -5
- data/vendor/depot_tools/third_party/logilab/common/corbautils.py +0 -117
- data/vendor/depot_tools/third_party/logilab/common/daemon.py +0 -101
- data/vendor/depot_tools/third_party/logilab/common/date.py +0 -335
- data/vendor/depot_tools/third_party/logilab/common/dbf.py +0 -231
- data/vendor/depot_tools/third_party/logilab/common/debugger.py +0 -214
- data/vendor/depot_tools/third_party/logilab/common/decorators.py +0 -281
- data/vendor/depot_tools/third_party/logilab/common/deprecation.py +0 -189
- data/vendor/depot_tools/third_party/logilab/common/fileutils.py +0 -404
- data/vendor/depot_tools/third_party/logilab/common/interface.py +0 -71
- data/vendor/depot_tools/third_party/logilab/common/logging_ext.py +0 -195
- data/vendor/depot_tools/third_party/logilab/common/modutils.py +0 -702
- data/vendor/depot_tools/third_party/logilab/common/optik_ext.py +0 -392
- data/vendor/depot_tools/third_party/logilab/common/optparser.py +0 -92
- data/vendor/depot_tools/third_party/logilab/common/proc.py +0 -277
- data/vendor/depot_tools/third_party/logilab/common/pyro_ext.py +0 -180
- data/vendor/depot_tools/third_party/logilab/common/pytest.py +0 -1199
- data/vendor/depot_tools/third_party/logilab/common/registry.py +0 -1119
- data/vendor/depot_tools/third_party/logilab/common/shellutils.py +0 -462
- data/vendor/depot_tools/third_party/logilab/common/sphinx_ext.py +0 -87
- data/vendor/depot_tools/third_party/logilab/common/sphinxutils.py +0 -122
- data/vendor/depot_tools/third_party/logilab/common/table.py +0 -929
- data/vendor/depot_tools/third_party/logilab/common/tasksqueue.py +0 -101
- data/vendor/depot_tools/third_party/logilab/common/testlib.py +0 -1392
- data/vendor/depot_tools/third_party/logilab/common/textutils.py +0 -537
- data/vendor/depot_tools/third_party/logilab/common/tree.py +0 -369
- data/vendor/depot_tools/third_party/logilab/common/umessage.py +0 -194
- data/vendor/depot_tools/third_party/logilab/common/ureports/__init__.py +0 -172
- data/vendor/depot_tools/third_party/logilab/common/ureports/docbook_writer.py +0 -140
- data/vendor/depot_tools/third_party/logilab/common/urllib2ext.py +0 -89
- data/vendor/depot_tools/third_party/logilab/common/visitor.py +0 -109
- data/vendor/depot_tools/third_party/logilab/common/xmlrpcutils.py +0 -131
- data/vendor/depot_tools/third_party/logilab/common/xmlutils.py +0 -61
data/vendor/depot_tools/third_party/{logilab/common → pylint/reporters}/ureports/text_writer.py
RENAMED
@@ -1,30 +1,25 @@
|
|
1
|
-
# copyright 2003-
|
1
|
+
# copyright 2003-2015 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
|
2
2
|
# contact http://www.logilab.fr/ -- mailto:contact@logilab.fr
|
3
3
|
#
|
4
4
|
# This file is part of logilab-common.
|
5
5
|
#
|
6
|
-
#
|
6
|
+
# pylint is free software: you can redistribute it and/or modify it under
|
7
7
|
# the terms of the GNU Lesser General Public License as published by the Free
|
8
8
|
# Software Foundation, either version 2.1 of the License, or (at your option) any
|
9
9
|
# later version.
|
10
10
|
#
|
11
|
-
#
|
11
|
+
# pylint is distributed in the hope that it will be useful, but WITHOUT
|
12
12
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
13
13
|
# FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
|
14
14
|
# details.
|
15
15
|
#
|
16
16
|
# You should have received a copy of the GNU Lesser General Public License along
|
17
|
-
# with
|
17
|
+
# with pylint. If not, see <http://www.gnu.org/licenses/>.
|
18
18
|
"""Text formatting drivers for ureports"""
|
19
19
|
|
20
20
|
from __future__ import print_function
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
from six.moves import range
|
25
|
-
|
26
|
-
from logilab.common.textutils import linesep
|
27
|
-
from logilab.common.ureports import BaseWriter
|
22
|
+
from pylint.reporters.ureports import BaseWriter
|
28
23
|
|
29
24
|
|
30
25
|
TITLE_UNDERLINES = [u'', u'=', u'-', u'`', u'.', u'~', u'^']
|
@@ -34,10 +29,9 @@ class TextWriter(BaseWriter):
|
|
34
29
|
"""format layouts as text
|
35
30
|
(ReStructured inspiration but not totally handled yet)
|
36
31
|
"""
|
37
|
-
def begin_format(self
|
38
|
-
super(TextWriter, self).begin_format(
|
32
|
+
def begin_format(self):
|
33
|
+
super(TextWriter, self).begin_format()
|
39
34
|
self.list_level = 0
|
40
|
-
self.pending_urls = []
|
41
35
|
|
42
36
|
def visit_section(self, layout):
|
43
37
|
"""display a section as text
|
@@ -45,11 +39,6 @@ class TextWriter(BaseWriter):
|
|
45
39
|
self.section += 1
|
46
40
|
self.writeln()
|
47
41
|
self.format_children(layout)
|
48
|
-
if self.pending_urls:
|
49
|
-
self.writeln()
|
50
|
-
for label, url in self.pending_urls:
|
51
|
-
self.writeln(u'.. _`%s`: %s' % (label, url))
|
52
|
-
self.pending_urls = []
|
53
42
|
self.section -= 1
|
54
43
|
self.writeln()
|
55
44
|
|
@@ -66,23 +55,15 @@ class TextWriter(BaseWriter):
|
|
66
55
|
self.format_children(layout)
|
67
56
|
self.writeln()
|
68
57
|
|
69
|
-
def visit_span(self, layout):
|
70
|
-
"""enter a span"""
|
71
|
-
self.format_children(layout)
|
72
|
-
|
73
58
|
def visit_table(self, layout):
|
74
59
|
"""display a table as text"""
|
75
60
|
table_content = self.get_table_content(layout)
|
76
61
|
# get columns width
|
77
62
|
cols_width = [0]*len(table_content[0])
|
78
63
|
for row in table_content:
|
79
|
-
for index in
|
80
|
-
col = row[index]
|
64
|
+
for index, col in enumerate(row):
|
81
65
|
cols_width[index] = max(cols_width[index], len(col))
|
82
|
-
|
83
|
-
self.field_table(layout, table_content, cols_width)
|
84
|
-
else:
|
85
|
-
self.default_table(layout, table_content, cols_width)
|
66
|
+
self.default_table(layout, table_content, cols_width)
|
86
67
|
self.writeln()
|
87
68
|
|
88
69
|
def default_table(self, layout, table_content, cols_width):
|
@@ -90,48 +71,21 @@ class TextWriter(BaseWriter):
|
|
90
71
|
cols_width = [size+1 for size in cols_width]
|
91
72
|
format_strings = u' '.join([u'%%-%ss'] * len(cols_width))
|
92
73
|
format_strings = format_strings % tuple(cols_width)
|
93
|
-
format_strings = format_strings.split(' ')
|
74
|
+
format_strings = format_strings.split(u' ')
|
94
75
|
table_linesep = u'\n+' + u'+'.join([u'-'*w for w in cols_width]) + u'+\n'
|
95
76
|
headsep = u'\n+' + u'+'.join([u'='*w for w in cols_width]) + u'+\n'
|
96
77
|
# FIXME: layout.cheaders
|
97
78
|
self.write(table_linesep)
|
98
|
-
for
|
79
|
+
for index, line in enumerate(table_content):
|
99
80
|
self.write(u'|')
|
100
|
-
|
101
|
-
|
102
|
-
self.write(format_strings[j] % line[j])
|
81
|
+
for line_index, at_index in enumerate(line):
|
82
|
+
self.write(format_strings[line_index] % at_index)
|
103
83
|
self.write(u'|')
|
104
|
-
if
|
84
|
+
if index == 0 and layout.rheaders:
|
105
85
|
self.write(headsep)
|
106
86
|
else:
|
107
87
|
self.write(table_linesep)
|
108
88
|
|
109
|
-
def field_table(self, layout, table_content, cols_width):
|
110
|
-
"""special case for field table"""
|
111
|
-
assert layout.cols == 2
|
112
|
-
format_string = u'%s%%-%ss: %%s' % (linesep, cols_width[0])
|
113
|
-
for field, value in table_content:
|
114
|
-
self.write(format_string % (field, value))
|
115
|
-
|
116
|
-
|
117
|
-
def visit_list(self, layout):
|
118
|
-
"""display a list layout as text"""
|
119
|
-
bullet = BULLETS[self.list_level % len(BULLETS)]
|
120
|
-
indent = ' ' * self.list_level
|
121
|
-
self.list_level += 1
|
122
|
-
for child in layout.children:
|
123
|
-
self.write(u'%s%s%s ' % (linesep, indent, bullet))
|
124
|
-
child.accept(self)
|
125
|
-
self.list_level -= 1
|
126
|
-
|
127
|
-
def visit_link(self, layout):
|
128
|
-
"""add a hyperlink"""
|
129
|
-
if layout.label != layout.url:
|
130
|
-
self.write(u'`%s`_' % layout.label)
|
131
|
-
self.pending_urls.append( (layout.label, layout.url) )
|
132
|
-
else:
|
133
|
-
self.write(layout.url)
|
134
|
-
|
135
89
|
def visit_verbatimtext(self, layout):
|
136
90
|
"""display a verbatim layout as text (so difficult ;)
|
137
91
|
"""
|
@@ -19,27 +19,26 @@ from __future__ import print_function
|
|
19
19
|
import collections
|
20
20
|
import contextlib
|
21
21
|
import functools
|
22
|
+
from glob import glob
|
22
23
|
import os
|
24
|
+
from os import linesep, getcwd, sep
|
25
|
+
from os.path import abspath, basename, dirname, isdir, join, splitext
|
23
26
|
import sys
|
24
27
|
import re
|
25
28
|
import unittest
|
26
29
|
import tempfile
|
27
30
|
import tokenize
|
28
31
|
|
29
|
-
|
30
|
-
from
|
31
|
-
from os.path import abspath, basename, dirname, isdir, join, splitext
|
32
|
-
|
33
|
-
from astroid import test_utils
|
32
|
+
import six
|
33
|
+
from six.moves import StringIO
|
34
34
|
|
35
|
+
import astroid
|
35
36
|
from pylint import checkers
|
36
37
|
from pylint.utils import PyLintASTWalker
|
37
38
|
from pylint.reporters import BaseReporter
|
38
39
|
from pylint.interfaces import IReporter
|
39
40
|
from pylint.lint import PyLinter
|
40
41
|
|
41
|
-
import six
|
42
|
-
from six.moves import StringIO
|
43
42
|
|
44
43
|
|
45
44
|
# Utils
|
@@ -126,9 +125,11 @@ class TestReporter(BaseReporter):
|
|
126
125
|
self.reset()
|
127
126
|
return result
|
128
127
|
|
129
|
-
def
|
128
|
+
def display_reports(self, layout):
|
130
129
|
"""ignore layouts"""
|
131
130
|
|
131
|
+
_display = None
|
132
|
+
|
132
133
|
|
133
134
|
class Message(collections.namedtuple('Message',
|
134
135
|
['msg_id', 'line', 'node', 'args'])):
|
@@ -168,9 +169,9 @@ class UnittestLinter(object):
|
|
168
169
|
|
169
170
|
def set_config(**kwargs):
|
170
171
|
"""Decorator for setting config values on a checker."""
|
171
|
-
def
|
172
|
+
def _wrapper(fun):
|
172
173
|
@functools.wraps(fun)
|
173
|
-
def
|
174
|
+
def _forward(self):
|
174
175
|
for key, value in six.iteritems(kwargs):
|
175
176
|
setattr(self.checker.config, key, value)
|
176
177
|
if isinstance(self, CheckerTestCase):
|
@@ -178,8 +179,8 @@ def set_config(**kwargs):
|
|
178
179
|
self.checker.open()
|
179
180
|
fun(self)
|
180
181
|
|
181
|
-
return
|
182
|
-
return
|
182
|
+
return _forward
|
183
|
+
return _wrapper
|
183
184
|
|
184
185
|
|
185
186
|
class CheckerTestCase(unittest.TestCase):
|
@@ -228,7 +229,6 @@ linter = PyLinter()
|
|
228
229
|
linter.set_reporter(test_reporter)
|
229
230
|
linter.config.persistent = 0
|
230
231
|
checkers.initialize(linter)
|
231
|
-
linter.global_set_option('required-attributes', ('__revision__',))
|
232
232
|
|
233
233
|
if linesep != '\n':
|
234
234
|
LINE_RGX = re.compile(linesep)
|
@@ -271,6 +271,7 @@ class LintTestUsingModule(unittest.TestCase):
|
|
271
271
|
|
272
272
|
def test_functionality(self):
|
273
273
|
tocheck = [self.package+'.'+self.module]
|
274
|
+
# pylint: disable=not-an-iterable; can't handle boolean checks for now
|
274
275
|
if self.depends:
|
275
276
|
tocheck += [self.package+'.%s' % name.replace('.py', '')
|
276
277
|
for name, _ in self.depends]
|
@@ -316,8 +317,9 @@ class LintTestUsingFile(LintTestUsingModule):
|
|
316
317
|
if not isdir(importable):
|
317
318
|
importable += '.py'
|
318
319
|
tocheck = [importable]
|
320
|
+
# pylint: disable=not-an-iterable; can't handle boolean checks for now
|
319
321
|
if self.depends:
|
320
|
-
tocheck += [join(self.INPUT_DIR, name) for name,
|
322
|
+
tocheck += [join(self.INPUT_DIR, name) for name, _ in self.depends]
|
321
323
|
self._test(tocheck)
|
322
324
|
|
323
325
|
class LintTestUpdate(LintTestUsingModule):
|
@@ -363,7 +365,7 @@ def make_tests(input_dir, msg_dir, filter_rgx, callbacks):
|
|
363
365
|
for module_file, messages_file in (
|
364
366
|
get_tests_info(input_dir, msg_dir, 'func_', '')
|
365
367
|
):
|
366
|
-
if not is_to_run(module_file) or module_file.endswith('.pyc'):
|
368
|
+
if not is_to_run(module_file) or module_file.endswith(('.pyc', "$py.class")):
|
367
369
|
continue
|
368
370
|
base = module_file.replace('func_', '').replace('.py', '')
|
369
371
|
|
@@ -390,23 +392,23 @@ def create_tempfile(content=None):
|
|
390
392
|
# Can't use tempfile.NamedTemporaryFile here
|
391
393
|
# because on Windows the file must be closed before writing to it,
|
392
394
|
# see http://bugs.python.org/issue14243
|
393
|
-
|
395
|
+
file_handle, tmp = tempfile.mkstemp()
|
394
396
|
if content:
|
395
397
|
if sys.version_info >= (3, 0):
|
396
398
|
# erff
|
397
|
-
os.write(
|
399
|
+
os.write(file_handle, bytes(content, 'ascii'))
|
398
400
|
else:
|
399
|
-
os.write(
|
401
|
+
os.write(file_handle, content)
|
400
402
|
try:
|
401
403
|
yield tmp
|
402
404
|
finally:
|
403
|
-
os.close(
|
405
|
+
os.close(file_handle)
|
404
406
|
os.remove(tmp)
|
405
407
|
|
406
408
|
@contextlib.contextmanager
|
407
409
|
def create_file_backed_module(code):
|
408
410
|
"""Create an astroid module for the given code, backed by a real file."""
|
409
411
|
with create_tempfile() as temp:
|
410
|
-
module =
|
412
|
+
module = astroid.parse(code)
|
411
413
|
module.file = temp
|
412
414
|
yield module
|
@@ -19,26 +19,24 @@ main pylint class
|
|
19
19
|
from __future__ import print_function
|
20
20
|
|
21
21
|
import collections
|
22
|
+
import itertools
|
22
23
|
import os
|
24
|
+
from os.path import dirname, basename, splitext, exists, isdir, join, normpath
|
23
25
|
import re
|
24
26
|
import sys
|
25
27
|
import tokenize
|
26
28
|
import warnings
|
27
|
-
|
29
|
+
import textwrap
|
28
30
|
|
29
31
|
import six
|
30
32
|
from six.moves import zip # pylint: disable=redefined-builtin
|
31
33
|
|
32
|
-
from logilab.common.interface import implements
|
33
|
-
from logilab.common.textutils import normalize_text
|
34
|
-
from logilab.common.configuration import rest_format_section
|
35
|
-
from logilab.common.ureports import Section
|
36
|
-
|
37
34
|
from astroid import nodes, Module
|
38
35
|
from astroid.modutils import modpath_from_file, get_module_files, \
|
39
36
|
file_from_modpath, load_module_from_file
|
40
37
|
|
41
|
-
from pylint.interfaces import IRawChecker, ITokenChecker, UNDEFINED
|
38
|
+
from pylint.interfaces import IRawChecker, ITokenChecker, UNDEFINED, implements
|
39
|
+
from pylint.reporters.ureports.nodes import Section
|
42
40
|
|
43
41
|
|
44
42
|
class UnknownMessage(Exception):
|
@@ -67,12 +65,29 @@ MSG_TYPES_STATUS = {
|
|
67
65
|
'F' : 1
|
68
66
|
}
|
69
67
|
|
68
|
+
DEPRECATED_ALIASES = {
|
69
|
+
# New name, deprecated name.
|
70
|
+
'repr': 'backquote',
|
71
|
+
'expr': 'discard',
|
72
|
+
'assignname': 'assname',
|
73
|
+
'assignattr': 'assattr',
|
74
|
+
'attribute': 'getattr',
|
75
|
+
'call': 'callfunc',
|
76
|
+
'importfrom': 'from',
|
77
|
+
'classdef': 'class',
|
78
|
+
'functiondef': 'function',
|
79
|
+
'generatorexp': 'genexpr',
|
80
|
+
}
|
81
|
+
|
70
82
|
_MSG_ORDER = 'EWRCIF'
|
71
83
|
MSG_STATE_SCOPE_CONFIG = 0
|
72
84
|
MSG_STATE_SCOPE_MODULE = 1
|
73
85
|
MSG_STATE_CONFIDENCE = 2
|
74
86
|
|
75
|
-
|
87
|
+
# Allow stopping after the first semicolon encountered,
|
88
|
+
# so that an option can be continued with the reasons
|
89
|
+
# why it is active or disabled.
|
90
|
+
OPTION_RGX = re.compile(r'\s*#.*\bpylint:\s*([^;]+);{0,1}')
|
76
91
|
|
77
92
|
# The line/node distinction does not apply to fatal errors and reports.
|
78
93
|
_SCOPE_EXEMPT = 'FR'
|
@@ -128,9 +143,8 @@ def category_id(cid):
|
|
128
143
|
return MSG_TYPES_LONG.get(cid)
|
129
144
|
|
130
145
|
|
131
|
-
def _decoding_readline(stream,
|
132
|
-
return lambda: stream.readline().decode(
|
133
|
-
'replace')
|
146
|
+
def _decoding_readline(stream, encoding):
|
147
|
+
return lambda: stream.readline().decode(encoding, 'replace')
|
134
148
|
|
135
149
|
|
136
150
|
def tokenize_module(module):
|
@@ -138,7 +152,8 @@ def tokenize_module(module):
|
|
138
152
|
readline = stream.readline
|
139
153
|
if sys.version_info < (3, 0):
|
140
154
|
if module.file_encoding is not None:
|
141
|
-
readline = _decoding_readline(stream, module)
|
155
|
+
readline = _decoding_readline(stream, module.file_encoding)
|
156
|
+
|
142
157
|
return list(tokenize.generate_tokens(readline))
|
143
158
|
return list(tokenize.tokenize(readline))
|
144
159
|
|
@@ -209,7 +224,7 @@ class MessageDefinition(object):
|
|
209
224
|
desc += " It can't be emitted when using Python %s." % restr
|
210
225
|
else:
|
211
226
|
desc += " This message can't be emitted when using Python %s." % restr
|
212
|
-
desc =
|
227
|
+
desc = _normalize_text(' '.join(desc.split()), indent=' ')
|
213
228
|
if title != '%s':
|
214
229
|
title = title.splitlines()[0]
|
215
230
|
return ':%s: *%s*\n%s' % (msgid, title, desc)
|
@@ -275,12 +290,32 @@ class MessagesHandlerMixIn(object):
|
|
275
290
|
msgs = self._msgs_state
|
276
291
|
msgs[msg.msgid] = False
|
277
292
|
# sync configuration object
|
278
|
-
self.config.disable = [
|
293
|
+
self.config.disable = [self._message_symbol(mid)
|
294
|
+
for mid, val in six.iteritems(msgs)
|
279
295
|
if not val]
|
280
296
|
|
297
|
+
def _message_symbol(self, msgid):
|
298
|
+
"""Get the message symbol of the given message id
|
299
|
+
|
300
|
+
Return the original message id if the message does not
|
301
|
+
exist.
|
302
|
+
"""
|
303
|
+
try:
|
304
|
+
return self.msgs_store.check_message_id(msgid).symbol
|
305
|
+
except UnknownMessage:
|
306
|
+
return msgid
|
307
|
+
|
281
308
|
def enable(self, msgid, scope='package', line=None, ignore_unknown=False):
|
282
309
|
"""reenable message of the given id"""
|
283
310
|
assert scope in ('package', 'module')
|
311
|
+
if msgid == 'all':
|
312
|
+
for msgid_ in MSG_TYPES:
|
313
|
+
self.enable(msgid_, scope=scope, line=line)
|
314
|
+
if not self._python3_porting_mode:
|
315
|
+
# Don't activate the python 3 porting checker if it
|
316
|
+
# wasn't activated explicitly.
|
317
|
+
self.disable('python3')
|
318
|
+
return
|
284
319
|
catid = category_id(msgid)
|
285
320
|
# msgid is a category?
|
286
321
|
if catid is not None:
|
@@ -428,7 +463,7 @@ class MessagesHandlerMixIn(object):
|
|
428
463
|
title = '%s options' % section.capitalize()
|
429
464
|
print(title)
|
430
465
|
print('~' * len(title))
|
431
|
-
|
466
|
+
_rest_format_section(sys.stdout, None, options)
|
432
467
|
print("")
|
433
468
|
else:
|
434
469
|
try:
|
@@ -463,7 +498,7 @@ class MessagesHandlerMixIn(object):
|
|
463
498
|
title = 'Options'
|
464
499
|
print(title)
|
465
500
|
print('^' * len(title))
|
466
|
-
|
501
|
+
_rest_format_section(sys.stdout, None, options)
|
467
502
|
print("")
|
468
503
|
if msgs:
|
469
504
|
title = 'Messages'
|
@@ -526,36 +561,39 @@ class FileState(object):
|
|
526
561
|
#
|
527
562
|
# this is necessary to disable locally messages applying to class /
|
528
563
|
# function using their fromlineno
|
529
|
-
if isinstance(node, (nodes.Module, nodes.
|
564
|
+
if (isinstance(node, (nodes.Module, nodes.ClassDef, nodes.FunctionDef))
|
565
|
+
and node.body):
|
530
566
|
firstchildlineno = node.body[0].fromlineno
|
531
567
|
else:
|
532
568
|
firstchildlineno = last
|
533
569
|
for msgid, lines in six.iteritems(msg_state):
|
534
570
|
for lineno, state in list(lines.items()):
|
535
571
|
original_lineno = lineno
|
536
|
-
if first
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
572
|
+
if first > lineno or last < lineno:
|
573
|
+
continue
|
574
|
+
# Set state for all lines for this block, if the
|
575
|
+
# warning is applied to nodes.
|
576
|
+
if msgs_store.check_message_id(msgid).scope == WarningScope.NODE:
|
577
|
+
if lineno > firstchildlineno:
|
578
|
+
state = True
|
579
|
+
first_, last_ = node.block_range(lineno)
|
580
|
+
else:
|
581
|
+
first_ = lineno
|
582
|
+
last_ = last
|
583
|
+
for line in range(first_, last_+1):
|
584
|
+
# do not override existing entries
|
585
|
+
if line in self._module_msgs_state.get(msgid, ()):
|
586
|
+
continue
|
587
|
+
if line in lines: # state change in the same block
|
588
|
+
state = lines[line]
|
589
|
+
original_lineno = line
|
590
|
+
if not state:
|
591
|
+
self._suppression_mapping[(msgid, line)] = original_lineno
|
592
|
+
try:
|
593
|
+
self._module_msgs_state[msgid][line] = state
|
594
|
+
except KeyError:
|
595
|
+
self._module_msgs_state[msgid] = {line: state}
|
596
|
+
del lines[lineno]
|
559
597
|
|
560
598
|
def set_msg_status(self, msg, line, status):
|
561
599
|
"""Set status (enabled/disable) for a given message at a given line"""
|
@@ -789,7 +827,6 @@ def expand_modules(files_or_modules, black_list):
|
|
789
827
|
try:
|
790
828
|
filepath = file_from_modpath(modname.split('.'))
|
791
829
|
if filepath is None:
|
792
|
-
errors.append({'key' : 'ignored-builtin-module', 'mod': modname})
|
793
830
|
continue
|
794
831
|
except (ImportError, SyntaxError) as ex:
|
795
832
|
# FIXME p3k : the SyntaxError is a Python bug and should be
|
@@ -815,7 +852,7 @@ class PyLintASTWalker(object):
|
|
815
852
|
|
816
853
|
def __init__(self, linter):
|
817
854
|
# callbacks per node types
|
818
|
-
self.nbstatements =
|
855
|
+
self.nbstatements = 0
|
819
856
|
self.visit_events = collections.defaultdict(list)
|
820
857
|
self.leave_events = collections.defaultdict(list)
|
821
858
|
self.linter = linter
|
@@ -864,15 +901,42 @@ class PyLintASTWalker(object):
|
|
864
901
|
its children, then leave events.
|
865
902
|
"""
|
866
903
|
cid = astroid.__class__.__name__.lower()
|
904
|
+
|
905
|
+
# Detect if the node is a new name for a deprecated alias.
|
906
|
+
# In this case, favour the methods for the deprecated
|
907
|
+
# alias if any, in order to maintain backwards
|
908
|
+
# compatibility.
|
909
|
+
old_cid = DEPRECATED_ALIASES.get(cid)
|
910
|
+
visit_events = ()
|
911
|
+
leave_events = ()
|
912
|
+
|
913
|
+
if old_cid:
|
914
|
+
visit_events = self.visit_events.get(old_cid, ())
|
915
|
+
leave_events = self.leave_events.get(old_cid, ())
|
916
|
+
if visit_events or leave_events:
|
917
|
+
msg = ("Implemented method {meth}_{old} instead of {meth}_{new}. "
|
918
|
+
"This will be supported until Pylint 2.0.")
|
919
|
+
if visit_events:
|
920
|
+
warnings.warn(msg.format(meth="visit", old=old_cid, new=cid),
|
921
|
+
PendingDeprecationWarning)
|
922
|
+
if leave_events:
|
923
|
+
warnings.warn(msg.format(meth="leave", old=old_cid, new=cid),
|
924
|
+
PendingDeprecationWarning)
|
925
|
+
|
926
|
+
visit_events = itertools.chain(visit_events,
|
927
|
+
self.visit_events.get(cid, ()))
|
928
|
+
leave_events = itertools.chain(leave_events,
|
929
|
+
self.leave_events.get(cid, ()))
|
930
|
+
|
867
931
|
if astroid.is_statement:
|
868
932
|
self.nbstatements += 1
|
869
933
|
# generate events for this node on each checker
|
870
|
-
for cb in
|
934
|
+
for cb in visit_events or ():
|
871
935
|
cb(astroid)
|
872
936
|
# recurse on children
|
873
937
|
for child in astroid.get_children():
|
874
938
|
self.walk(child)
|
875
|
-
for cb in
|
939
|
+
for cb in leave_events or ():
|
876
940
|
cb(astroid)
|
877
941
|
|
878
942
|
|
@@ -922,3 +986,163 @@ def get_global_option(checker, option, default=None):
|
|
922
986
|
if options[0] == option:
|
923
987
|
return getattr(provider.config, option.replace("-", "_"))
|
924
988
|
return default
|
989
|
+
|
990
|
+
|
991
|
+
def deprecated_option(shortname=None, opt_type=None, help_msg=None):
|
992
|
+
def _warn_deprecated(option, optname, *args): # pylint: disable=unused-argument
|
993
|
+
msg = ("Warning: option %s is obsolete and "
|
994
|
+
"it is slated for removal in Pylint 1.6.\n")
|
995
|
+
sys.stderr.write(msg % (optname,))
|
996
|
+
|
997
|
+
option = {
|
998
|
+
'help': help_msg,
|
999
|
+
'hide': True,
|
1000
|
+
'type': opt_type,
|
1001
|
+
'action': 'callback',
|
1002
|
+
'callback': _warn_deprecated,
|
1003
|
+
'deprecated': True
|
1004
|
+
}
|
1005
|
+
if shortname:
|
1006
|
+
option['shortname'] = shortname
|
1007
|
+
return option
|
1008
|
+
|
1009
|
+
|
1010
|
+
def _splitstrip(string, sep=','):
|
1011
|
+
"""return a list of stripped string by splitting the string given as
|
1012
|
+
argument on `sep` (',' by default). Empty string are discarded.
|
1013
|
+
|
1014
|
+
>>> _splitstrip('a, b, c , 4,,')
|
1015
|
+
['a', 'b', 'c', '4']
|
1016
|
+
>>> _splitstrip('a')
|
1017
|
+
['a']
|
1018
|
+
>>>
|
1019
|
+
|
1020
|
+
:type string: str or unicode
|
1021
|
+
:param string: a csv line
|
1022
|
+
|
1023
|
+
:type sep: str or unicode
|
1024
|
+
:param sep: field separator, default to the comma (',')
|
1025
|
+
|
1026
|
+
:rtype: str or unicode
|
1027
|
+
:return: the unquoted string (or the input string if it wasn't quoted)
|
1028
|
+
"""
|
1029
|
+
return [word.strip() for word in string.split(sep) if word.strip()]
|
1030
|
+
|
1031
|
+
|
1032
|
+
def _unquote(string):
|
1033
|
+
"""remove optional quotes (simple or double) from the string
|
1034
|
+
|
1035
|
+
:type string: str or unicode
|
1036
|
+
:param string: an optionally quoted string
|
1037
|
+
|
1038
|
+
:rtype: str or unicode
|
1039
|
+
:return: the unquoted string (or the input string if it wasn't quoted)
|
1040
|
+
"""
|
1041
|
+
if not string:
|
1042
|
+
return string
|
1043
|
+
if string[0] in '"\'':
|
1044
|
+
string = string[1:]
|
1045
|
+
if string[-1] in '"\'':
|
1046
|
+
string = string[:-1]
|
1047
|
+
return string
|
1048
|
+
|
1049
|
+
|
1050
|
+
def _normalize_text(text, line_len=80, indent=''):
|
1051
|
+
"""Wrap the text on the given line length."""
|
1052
|
+
return '\n'.join(textwrap.wrap(text, width=line_len, initial_indent=indent,
|
1053
|
+
subsequent_indent=indent))
|
1054
|
+
|
1055
|
+
|
1056
|
+
def _check_csv(value):
|
1057
|
+
if isinstance(value, (list, tuple)):
|
1058
|
+
return value
|
1059
|
+
return _splitstrip(value)
|
1060
|
+
|
1061
|
+
|
1062
|
+
if six.PY2:
|
1063
|
+
def _encode(string, encoding):
|
1064
|
+
# pylint: disable=undefined-variable
|
1065
|
+
if isinstance(string, unicode):
|
1066
|
+
return string.encode(encoding)
|
1067
|
+
return str(string)
|
1068
|
+
else:
|
1069
|
+
def _encode(string, _):
|
1070
|
+
return str(string)
|
1071
|
+
|
1072
|
+
def _get_encoding(encoding, stream):
|
1073
|
+
encoding = encoding or getattr(stream, 'encoding', None)
|
1074
|
+
if not encoding:
|
1075
|
+
import locale
|
1076
|
+
encoding = locale.getpreferredencoding()
|
1077
|
+
return encoding
|
1078
|
+
|
1079
|
+
|
1080
|
+
def _comment(string):
|
1081
|
+
"""return string as a comment"""
|
1082
|
+
lines = [line.strip() for line in string.splitlines()]
|
1083
|
+
return '# ' + ('%s# ' % os.linesep).join(lines)
|
1084
|
+
|
1085
|
+
|
1086
|
+
def _format_option_value(optdict, value):
|
1087
|
+
"""return the user input's value from a 'compiled' value"""
|
1088
|
+
if isinstance(value, (list, tuple)):
|
1089
|
+
value = ','.join(value)
|
1090
|
+
elif isinstance(value, dict):
|
1091
|
+
value = ','.join('%s:%s' % (k, v) for k, v in value.items())
|
1092
|
+
elif hasattr(value, 'match'): # optdict.get('type') == 'regexp'
|
1093
|
+
# compiled regexp
|
1094
|
+
value = value.pattern
|
1095
|
+
elif optdict.get('type') == 'yn':
|
1096
|
+
value = value and 'yes' or 'no'
|
1097
|
+
elif isinstance(value, six.string_types) and value.isspace():
|
1098
|
+
value = "'%s'" % value
|
1099
|
+
return value
|
1100
|
+
|
1101
|
+
|
1102
|
+
def _ini_format_section(stream, section, options, encoding=None, doc=None):
|
1103
|
+
"""format an options section using the INI format"""
|
1104
|
+
encoding = _get_encoding(encoding, stream)
|
1105
|
+
if doc:
|
1106
|
+
print(_encode(_comment(doc), encoding), file=stream)
|
1107
|
+
print('[%s]' % section, file=stream)
|
1108
|
+
_ini_format(stream, options, encoding)
|
1109
|
+
|
1110
|
+
|
1111
|
+
def _ini_format(stream, options, encoding):
|
1112
|
+
"""format options using the INI format"""
|
1113
|
+
for optname, optdict, value in options:
|
1114
|
+
value = _format_option_value(optdict, value)
|
1115
|
+
help = optdict.get('help')
|
1116
|
+
if help:
|
1117
|
+
help = _normalize_text(help, line_len=79, indent='# ')
|
1118
|
+
print(file=stream)
|
1119
|
+
print(_encode(help, encoding), file=stream)
|
1120
|
+
else:
|
1121
|
+
print(file=stream)
|
1122
|
+
if value is None:
|
1123
|
+
print('#%s=' % optname, file=stream)
|
1124
|
+
else:
|
1125
|
+
value = _encode(value, encoding).strip()
|
1126
|
+
print('%s=%s' % (optname, value), file=stream)
|
1127
|
+
|
1128
|
+
format_section = _ini_format_section
|
1129
|
+
|
1130
|
+
|
1131
|
+
def _rest_format_section(stream, section, options, encoding=None, doc=None):
|
1132
|
+
"""format an options section using as ReST formatted output"""
|
1133
|
+
encoding = _get_encoding(encoding, stream)
|
1134
|
+
if section:
|
1135
|
+
print('%s\n%s' % (section, "'"*len(section)), file=stream)
|
1136
|
+
if doc:
|
1137
|
+
print(_encode(_normalize_text(doc, line_len=79, indent=''), encoding), file=stream)
|
1138
|
+
print(file=stream)
|
1139
|
+
for optname, optdict, value in options:
|
1140
|
+
help = optdict.get('help')
|
1141
|
+
print(':%s:' % optname, file=stream)
|
1142
|
+
if help:
|
1143
|
+
help = _normalize_text(help, line_len=79, indent=' ')
|
1144
|
+
print(_encode(help, encoding), file=stream)
|
1145
|
+
if value:
|
1146
|
+
value = _encode(_format_option_value(optdict, value), encoding)
|
1147
|
+
print(file=stream)
|
1148
|
+
print(' Default: ``%s``' % value.replace("`` ", "```` ``"), file=stream)
|