All __future__ imports (unicode_literals, print_function) are already
mandatory in py3. Also remove an outdated py2 comment in
presubmit_canned_checks.py
Bug: 1475402
Change-Id: I27cf6a8268f6dd1081f22af782c4c29a975376ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4867135
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Leave the recipes/ code at 2 space to match the rest of the recipes
project in other repos.
Reformatted using:
files=( $(
git ls-tree -r --name-only HEAD | \
grep -Ev -e '^(third_party|recipes)/' | \
grep '\.py$';
git grep -l '#!/usr/bin/env.*python' | grep -v '\.py$'
) )
parallel ./yapf -i -- "${files[@]}"
~/chromiumos/chromite/contrib/reflow_overlong_comments "${files[@]}"
The files that still had strings that were too long were manually
reformatted because they were easy and only a few issues.
autoninja.py
clang_format.py
download_from_google_storage.py
fix_encoding.py
gclient_utils.py
git_cache.py
git_common.py
git_map_branches.py
git_reparent_branch.py
gn.py
my_activity.py
owners_finder.py
presubmit_canned_checks.py
reclient_helper.py
reclientreport.py
roll_dep.py
rustfmt.py
siso.py
split_cl.py
subcommand.py
subprocess2.py
swift_format.py
upload_to_google_storage.py
These files still had lines (strings) that were too long, so the pylint
warnings were suppressed with a TODO.
auth.py
gclient.py
gclient_eval.py
gclient_paths.py
gclient_scm.py
gerrit_util.py
git_cl.py
presubmit_canned_checks.py
presubmit_support.py
scm.py
Change-Id: Ia6535c4f2c48d46b589ec1e791dde6c6b2ea858f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4836379
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Mike Frysinger <vapier@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
python3 is the only supported version of python in depot_tools.
Bug: 1475402
Change-Id: Ic925af3a79311b11a953f1d0d4602754488a9de3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4824480
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Interrupting is reported with exit_code 1 in metrics and makes it harder
to determine if a user canceled git cl.
Change-Id: I99f35378dcf02cffa39a05317651fcd2c6a0b520
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4684512
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.
Bug:1262286
Change-Id: I4b8f8fc521386419a3121bbb07edc8ac83170a94
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413679
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
This reverts commit 22bf605bb6.
Reason for revert: breaks gclient sync
Original change's description:
> Use pylint 2.7 for depot_tools
>
> This includes a few fixes for specific errors, and disables several new
> warnings introduced in this version, in order to allow for an incremental migration.
>
> Bug:1262286
> Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Bug: 1262286
Change-Id: Ieb946073c7886c7bf056ce843a5a48e82becf7a5
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3413672
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This includes a few fixes for specific errors, and disables several new
warnings introduced in this version, in order to allow for an incremental migration.
Bug:1262286
Change-Id: Ie97d686748c9c952e87718a65f401c5f6f80a5c9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3400616
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Aravind Vasudevan <aravindvasudev@google.com>
Before crrev.com/c/2876082, DEPOT_TOOLS_METRICS=0 was the
env var used to disable metrics collection.
Bug: b/191388102
Change-Id: I0db9d034562f2eb1afb53818b3853cef50c09826
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2980230
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Jack Neus <jackneus@google.com>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Jack Neus <jackneus@google.com>
If the DEPOT_TOOLS_REPORT_BUILD envvar is set, Depot Tools will
report information about the builder running the command
(e.g. buildbucket project, bucket, builder and build id).
It will also authenticate to the metrics server, and ignore any
requests not made by ChOps service accounts.
Change-Id: I078a4c2170b4226086c42f289fa449bdebc87179
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2861213
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@google.com>
Update metrics.README.md and add a metrics_version field.
Bug: None
Change-Id: I17d9032bd787af2a6fc49f80d59e05152d5223b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1406256
Reviewed-by: Andy Perelson <ajp@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
This enables gclient sync and gclient runhooks to run, barring hook script failures.
git cl upload also now works.
The scripts still work with Python 2.
There are no intended behaviour changes.
Bug: 942522
Change-Id: I2ac587b5f803ba7f5bb5e412337ce049f4b1a741
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1524583
Commit-Queue: Raul Tambre <raul@tambre.ee>
Reviewed-by: Dirk Pranke <dpranke@chromium.org>
It breaks gclient for some users depending on locale settings (see bug).
The feature just doesn't seem worth the complexity.
Bug: 934279
Change-Id: I2c6e2b77ab764381db9f2c4e63ff8a84526769bb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1520646
Reviewed-by: Elliott Friedman <friedman@chromium.org>
Reviewed-by: Ryan Tseng <hinoka@chromium.org>
Commit-Queue: Ryan Tseng <hinoka@chromium.org>
Auto-Submit: Hans Wennborg <hans@chromium.org>
The Unicode box drawing turn out malformed on Windows (even with
fix_encoding.py). This CL refactors the box drawing code, and makes
Windows box drawing use regular ASCII characters. Details:
* Add print_red_boxed_text() to programatically print box aroun given
list og strings.
* Unicode box drawing characters are escaped, removing the use of
non-ASCII characters in source code.
* Convert message source to generators for greater flexibilty, and
remove the need for manual horizontal padding.
* Add proper use colorama with Style.BRIGNT and Style.RESET_ALL.
* For Windows, revert to ASCII characters for box drawing.
Change-Id: I71a728db480709b4376d538aaecd701f9197e7ac
Reviewed-on: https://chromium-review.googlesource.com/c/1461249
Commit-Queue: Samuel Huang <huangs@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ METRICS COLLECTION IS TAKING PLACE ┃
┃ ┃
┃ To suppress this message opt in or out using: ┃
┃ $ gclient metrics [--opt-in] [--opt-out] ┃
┃ For more information please see metrics.README.md ┃
┃ in your depot_tools checkout or visit ┃
┃ https://goo.gl/yNpRDV. ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
R=ehmaldonado, mmoss, tandrii
Change-Id: Iab3a5a18aa57e603c8f253f3fcbbf7f96727e003
Reviewed-on: https://chromium-review.googlesource.com/c/1368409
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
Commit-Queue: Elliott Friedman <friedman@chromium.org>
Mentioning these commands make it easier for folks to get rid of the
large notice.
Bug: None
Change-Id: I85dd0e1ec0d33999af46f9e20b95bea05bd40a1e
Reviewed-on: https://chromium-review.googlesource.com/c/1330181
Auto-Submit: Peter Boström <pbos@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
When we change the version number in metrics_utils:
If the user is not a Googler, or has opted out explicitly, nothing happens
and we still don't collect metrics.
If we're collecting metrics from the user, we stop collecting metrics
and display a notice telling them what has changed.
That notice will be displayed ten times, after which we will
resume collecting metrics. A notice telling them we're collecting metrics
will still be displayed.
Bug: None
Change-Id: If1cc12b2fc06f0d6237714c4f182367b1afdf9fb
Reviewed-on: https://chromium-review.googlesource.com/c/1285395
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Print notice to stderr to avoid interfering with scripts that parse stdout.
Bug: 832386
Change-Id: Ifbcc52809213311489f5c8434b3c16ea53373e57
Reviewed-on: https://chromium-review.googlesource.com/1145697
Reviewed-by: Michael Moss <mmoss@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>