Commit Graph

17 Commits (cc3373c0e481cc3916e38c34c50579ebb6778c98)

Author SHA1 Message Date
Gavin Mak edba22d4eb Fix multiline comment formatting
Many incorrectly formatted comments exist from the switch to
4 space indent: https://crrev.com/c/4836379

Bug: 1514505
Change-Id: I6366f9da812919bd35b999f18fa8a49b7a66c09b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153633
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Mike Frysinger 124bb8e53c switch to 4 space indent
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>
2 years ago
Josip Sokcevic 940cd8e20f Use empty argument list in cmdhelp
If a wrong command name is used (e.g. typo), cmdhelp is triggered.
However, if user specifies any additional arguments (other than -h),
then user is presented with not so useful message.

This CL calls cmdhelp with no arguments.

Fixed: 1352093
Change-Id: I30c0b5f580f18b4fa2cb59d3195b67bb083f3442
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3828794
Reviewed-by: Aravind Vasudevan <aravindvasudev@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@google.com>
3 years ago
Aravind Vasudevan c5f0cbb865 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: 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>
3 years ago
Josip Sokcevic 42c5bbbc96 Revert "Use pylint 2.7 for depot_tools"
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>
3 years ago
Aravind Vasudevan 22bf605bb6 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>
3 years ago
Quinten Yearsley 925cedba7b Run spellchecker on depot_tools
This was made by running `codespell` and `scspell`
and then checking the results.

Change-Id: I169fd5b40294f83015075b4a899fbca263821f25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2144602
Commit-Queue: Quinten Yearsley <qyearsley@chromium.org>
Auto-Submit: Quinten Yearsley <qyearsley@chromium.org>
Reviewed-by: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 1c3b4bec47 subcommand: Add tests.
Change-Id: I730f364f30b0d211c2db6da0d6bb4f5ff3c948da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1999280
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
5 years ago
Edward Lemur 921f6a1751 depot_toools: Make subcommand Python 3 compatible.
Bug: 984182
Change-Id: I5d1b5626eb799975539560ca1508af92df326d47
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/1721916
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
Reviewed-by: Robbie Iannucci <iannucci@chromium.org>
Auto-Submit: Edward Lesmes <ehmaldonado@chromium.org>
6 years ago
Michael Achenbach 7f8c775571 Revert "gclient: return non-zero exit code on unknown command"
This reverts commit 2c199e1ec4.

Reason for revert: This makes calls to gclient that have the only intention of updating gclient fail, like:
https://cs.chromium.org/chromium/src/v8/tools/try_perf.py?l=93

Reverting for now to give time to clean up such scripts before reland.

Original change's description:
> gclient: return non-zero exit code on unknown command
> 
> Bug: none
> Change-Id: I447f66765679b7b66b5748af1cf1f501610603bf
> Reviewed-on: https://chromium-review.googlesource.com/504408
> Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
> Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
> 

TBR=iannucci@chromium.org,phajdan.jr@chromium.org,dpranke@chromium.org,tandrii@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Bug: none

Change-Id: I9496f7192dfde1e38c186a94ac985190b76b2438
Reviewed-on: https://chromium-review.googlesource.com/506563
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
8 years ago
Paweł Hajdan, Jr 2c199e1ec4 gclient: return non-zero exit code on unknown command
Bug: none
Change-Id: I447f66765679b7b66b5748af1cf1f501610603bf
Reviewed-on: https://chromium-review.googlesource.com/504408
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Paweł Hajdan Jr. <phajdan.jr@chromium.org>
8 years ago
maruel@chromium.org 6dc64d3781 Automatically upgrade '_' to '-' when finding the right command.
This doesn't change the automatic command finder, so it really only helps
increase match hit rate in case of low confidence level delta between the 2 top
hits. For example, given commands 'set-commit' and 'dcommit', a user typing
'set_commit' would hit:
- 'set-commit': 90%
- 'dcommit': 70.5%

Since subcommand.py uses a 30% minimum confidence level between the two top hit
to automatically select a command, it will err on the side of safety and will
abort instead of selecting 'set-commit'.

This change fixes this specific case but won't trigger on partial matches, e.g.
'set_commi' for 'set-commit'.

R=stip@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1066923003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294700 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
maruel@chromium.org 9f7fd12112 Formalizes support for '-' in command names.
This officially drops support for '_' in command names, which is ugly as hell.
'_' was very rarely used so it shouldn't affect too much users.

Refactor the code to be more readable.

R=stip@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1040503003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@294660 0039d316-1c4b-4281-b951-d872f2087c98
10 years ago
maruel@chromium.org 29404b59d2 Add git cl lol.
Because everyone needs humour.

Fix a small bug in subcommands.py with undocumented commands.

R=stip@chromium.org
BUG=

Review URL: https://codereview.chromium.org/554123003

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291867 0039d316-1c4b-4281-b951-d872f2087c98
11 years ago
maruel@chromium.org 89f91d417f Add transparent dash support to commands.
This makes it easier to type without using the shift-key, so an user can type
'git cl set-commit' and it'll find CMDset_commit.

R=xusydoc@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/22918019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@219054 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 39c0b22fd3 Convert gclient to use subcommand.py
Update subcommand to support examples, always disable format_description and
format_epilog and add colors when enabled.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/22824018

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@218180 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago
maruel@chromium.org 0633fb4ff2 Split generic subcommand code off its own module.
Use the code in git_cl.py, since it was the more evolved. Add documentation
and clean up the structure along the way.

This makes it possible to easily reuse the generic subcommand handling code.

As a first step, only git_cl.py is using it. Eventually, gclient and gcl could
be switch over.

R=iannucci@chromium.org
BUG=

Review URL: https://chromiumcodereview.appspot.com/23250002

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@218072 0039d316-1c4b-4281-b951-d872f2087c98
12 years ago