Commit Graph

448 Commits (main)

Author SHA1 Message Date
Yiwei Zhang e5159abea6 Add CheckNewDEPSHooksHasRequiredReviewers canned check
This will later be used in chromium PRESUBMIT to ensure newly added DEPS
hook MUST be reviewed by a dedicated reviewer.

Bug: 396736534
Change-Id: I3859814c6316d4e576d12114277671ed5db80e33
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6284565
Commit-Queue: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Dirk Pranke <dpranke@google.com>
2 days ago
Josip Sokcevic 9fd46c2b6b [presubmit] Check if .gitmodules diverges from DEPS
Raise presubmit error if .gitmodules file contains entry that doesn't
have gitlink, nor DEPS entry. This is desired as some tooling started to
depend on .gitmodules to learn about git dependencies.

Tested manually on chromium/src, based on the bug report test case.

R=ddoman@google.com

Bug: 392766700
Change-Id: I9dd8e03503b151f75e548acd0af098f342fc77a6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6219822
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
4 weeks ago
Jordan Brown fd65288d4a Add `is_open_source_project` to metadata validation
Reciprocal licenses can only be used in open source projects.
This change updates the presubmit validation checks to accept an
optional flag `allow_reciprocal_licenses`. When True, the allowlist is
extended to include reciprocal licenses.

Bug: 385020146
Change-Id: I0374658207bc87ffd74e033762ee4973c6e83b3b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6107863
Reviewed-by: Jordan Brown <rop@google.com>
Auto-Submit: Jordan Brown <rop@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Commit-Queue: Rachael Newitt <renewitt@google.com>
2 months ago
Mike Frysinger 0d07dd258c pylint: add v3.2 support
Change-Id: I120bd70adda6ea53e976ba47aa63d1dc622c6663
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6150454
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2 months ago
Mike Frysinger d6c2e1b339 presubmit_canned_checks: hack to avoid analyzer triggers
The analyzer is finding these literal strings and putting error
messages into new CLs.  Hack the string up to avoid that.

Change-Id: I8335e6f5e29ca4c2257010629f46036bc250ff73
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6147794
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
2 months ago
Yiwei Zhang 40ef124163 exempt LINT.ThenChange line when checking long line
LINT.ThenChange is followed by path which sometimes may exceed the
length limit

Bug: 382239821
Change-Id: I2142fd3326704593bd46c8937b1bb904bcef4763
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6077446
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
3 months ago
Erik Staab 67ddd5efb7 Update holiday freeze dates to reflect policy
Context: http://shortn/_5jjB9kobEg (internal)

Change-Id: I4ad85fb57914ef6577704f5ba9f3f13f2f530c25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6075718
Commit-Queue: Erik Staab <estaab@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
3 months ago
Gary Tong bd7f36598e Make the freeze check Chromium-specific and update dates
Bug: 381098374
Change-Id: I52456322481e546f48175e33ef330dfd8306c28c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6048214
Auto-Submit: Gary Tong <gatong@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Garrett Beaty <gbeaty@google.com>
Commit-Queue: Gary Tong <gatong@chromium.org>
3 months ago
Gavin Mak c0796a593a Revert "Update freeze dates for 2024 Thanksgiving week"
This reverts commit 584e8366be.

Reason for revert: Android freeze, not Chrome

Original change's description:
> Update freeze dates for 2024 Thanksgiving week
>
> Change-Id: I20b1bb68d181f5d05f7dc91f270cbd97a26409ae
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6049175
> Auto-Submit: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Brian Ryner <bryner@google.com>
> Reviewed-by: Brian Ryner <bryner@google.com>

Change-Id: I139470cec0e786658e08344090b1a5a658d2ca28
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6052245
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Gavin Mak <gavinmak@google.com>
3 months ago
Gavin Mak 584e8366be Update freeze dates for 2024 Thanksgiving week
Change-Id: I20b1bb68d181f5d05f7dc91f270cbd97a26409ae
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/6049175
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Brian Ryner <bryner@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
3 months ago
Philipp Wollermann c4d75a1519 presubmit: Improve CheckInfraFreeze error message
I didn't understand from the error message how to correctly set the git-footer in my commit message, so that the override takes effect.

Maybe this version is easier for new devs?

Change-Id: I745d80f0e8068500137d9382f423d0c65a922f5b
Ignore-Freeze: Low risk
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5930648
Auto-Submit: Philipp Wollermann <philwo@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
5 months ago
Josip Sokcevic ed89aaf597 Update freeze dates for 2024, internal conference
Change-Id: If5d90a728ce765a7c6ad451a58698c59ec563b44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5913187
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Erik Staab <estaab@chromium.org>
5 months ago
Scott Lee 17a0d843c1 allow comment lines in inclusive_language_presubmit_exempt_dirs.txt
inclusive_language_presubmit_exempt_dirs.txt is a list of
paths to exclude from the inclusive word presubmit check.
https://source.chromium.org/chromium/chromium/tools/depot_tools/+/main:presubmit_canned_checks.py;l=2602;drc=0bc7c4832e4f2d453e4826c9a2e1197e11bd6ec7

This CL allows comment lines, starting with \#, in the file.
(Also, fixes a bug to allow an empty line)

Bug: 369701326
Change-Id: I7647459281f7921362aa4070c26671f321b7cfea
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5906016
Auto-Submit: Scott Lee <ddoman@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
5 months ago
Josip Sokcevic 0bc7c4832e [PRESUBMIT] Read DEPS file from Git in CheckForCommitObjects
CheckForCommitObjects is not working correctly if there is a
PanProjectChecks in non-root PRESUBMIT.py together with a DEPS file in
the same directory. Instead, PRESUBMIT needs to check the root DEPS
file.

In order to get commit objects (gitlink), we need to run Git ops.  This
patch relies on Git to provide the root DEPS file.

R=gavinmak@google.com

Fixed: 359944302
Change-Id: I7934a24c1ea8e6b6daa2f936ad4209ad9cdad5ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5784174
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
7 months ago
Josip Sokcevic 2517f89cdf Reland "[presubmit checks] Check if files are written to a dep dir"
This is a reland of commit 561772c448

Original change's description:
> [presubmit checks] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> R=jojwang@google.com
>
> Bug: 343199633
> Change-Id: I8d3414eac728580eaf9ac7e337bb22bca3989e4e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633187
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Bug: 343199633
Change-Id: Ifc3f6c4df328cdd215ceb7d0333f68223e9a1ccb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5643922
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
8 months ago
Gavin Mak 4d36c419f3 Revert "[presubmit checks] Check if files are written to a dep dir"
This reverts commit 561772c448.

Reason for revert: `KeyError: 'deps'` breaking some builds

Original change's description:
> [presubmit checks] Check if files are written to a dep dir
>
> No files should be written to a directory that's used by CIPD or GCS, as
> defined in DEPS. Git already doesn't allow files to be written to a
> directory that's a gitlink.
>
> R=jojwang@google.com
>
> Bug: 343199633
> Change-Id: I8d3414eac728580eaf9ac7e337bb22bca3989e4e
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633187
> Reviewed-by: Gavin Mak <gavinmak@google.com>
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>

Bug: 343199633
Change-Id: I26b8e72320260e394a72aee1f7e67dfc2b3e2987
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5641258
Auto-Submit: Gavin Mak <gavinmak@google.com>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
8 months ago
Josip Sokcevic 561772c448 [presubmit checks] Check if files are written to a dep dir
No files should be written to a directory that's used by CIPD or GCS, as
defined in DEPS. Git already doesn't allow files to be written to a
directory that's a gitlink.

R=jojwang@google.com

Bug: 343199633
Change-Id: I8d3414eac728580eaf9ac7e337bb22bca3989e4e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5633187
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
9 months ago
Yiwei Zhang fdfc24e36a run tests using python 3.8
This is achieved by duplicating vpython spec in tests directory and
changing the python version to 3.8. The reason for this change is that
even though depot_tools support 3.11, the entire infra is still on
3.8 so any new 3.8+ feature used in depot_tools may break infra test and
it has already happened couple of times.

Bug: 346784198
Change-Id: I7dbd0d926da21854abf47af2c2f6edfeec2c5c4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5625090
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
9 months ago
Josip Sokcevic 0dd5028133 [presubmit] Add check for recursedeps entries
All DEPS entries in recursedeps array should be defined in deps map. If
not, raise presubmit error.

R=gavinmak@google.com

Fixed: b/340948588
Change-Id: I13c3741577cf26e116493834f4825468fe74569a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5547691
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
9 months ago
Gavin Mak e75b940aea Skip CheckForCommitObjects if not git change
The check relies on `git ls-tree` which is unavailable for non-git
workspaces.

Bug: 333744051
Change-Id: Ib9151a283c3bf543390f2cf06e0ce213051fb509
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5503095
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
10 months ago
Gavin Mak 14cccc4b9a Make CheckChangedLUCIConfigs work on non-git workspace
The check relies on cl.GetRemoteBranch() and cl.GetRemoteUrl() that
both rely on git. Provide that info with Gerrit info from input_api
if available instead of always calling git.

Bug: 333744051
Change-Id: I915d6451d808c9bf871804d116ea884294ee7c84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5479889
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Riley Wong <rgw@google.com>
10 months ago
Joanna Wang be47bdd965 Reland "Include host and project in code-owners not enabled error."
This is a reland of commit 4d2728b03e

Added default values for host and project in case input.gerrit does not
exist.

Original change's description:
> Include host and project in code-owners not enabled error.
>
> Bug: 329231688
> Change-Id: I36bb24f167854f40718ec49559d9aaa640fa1a44
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5384365
> Auto-Submit: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Scott Lee <ddoman@chromium.org>

Bug: 329231688
Change-Id: If65e362d0aba97d804a75c078452bab8152ae224
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5384366
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
11 months ago
Joanna Wang 9a5440a442 Revert "Include host and project in code-owners not enabled error."
This reverts commit 4d2728b03e.

Reason for revert: Won't work if gerrit=None

Original change's description:
> Include host and project in code-owners not enabled error.
>
> Bug: 329231688
> Change-Id: I36bb24f167854f40718ec49559d9aaa640fa1a44
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5384365
> Auto-Submit: Joanna Wang <jojwang@chromium.org>
> Commit-Queue: Joanna Wang <jojwang@chromium.org>
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Scott Lee <ddoman@chromium.org>

Bug: 329231688
Change-Id: I49d23611b62f1979578ae52861a2007a1d34778e
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5381788
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
11 months ago
Joanna Wang 4d2728b03e Include host and project in code-owners not enabled error.
Bug: 329231688
Change-Id: I36bb24f167854f40718ec49559d9aaa640fa1a44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5384365
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
12 months ago
Brian Ryner 1a92126938 Delete vpython, leaving only vpython3.
Reland of https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5187892

Bug: 1376538
Change-Id: I6947cf2a54ec2b45b2540ad0784fafe73f44c441
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5343135
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Eli Ribble <eliribble@google.com>
Commit-Queue: Brian Ryner <bryner@google.com>
12 months ago
Gavin Mak b1b1a43f07 Move LSC check into pan project presubmit checks and check num files
git cl upload prompts a user if they upload a particularly large change,
determined by the number of CCs added on the change. With the watchlists
analyzer and eventual removal of CCing watchers from git cl, this check
needs to be updated to work without knowing the number of CCs.

This change does two things:
1. Moves the check from git cl upload to a pan-project presubmit check.
2. Update the heuristic of a LSC from > 100 CCs to > 100 files modified.

Bug: 324562917
Change-Id: I6bd0db9fde942273acebc320c8b52e81b02bd42f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5296199
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year ago
Gavin Mak a4dee1b821 Make CheckForCommitObjects check gitlinks and .gitmodules
issues.skia.org/issues/324072603: DEPS were renamed but the
corresponding gitlinks and gitmodules entry were not updated. Update
to check that

1. DEPS entries point to gitlinks (if SYNC)
2. .gitmodules entries match paths of gitlinks

Bug: 324118800
Change-Id: I4c97b54c1912712aef309584bebaa4ea3b24d5df
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5273762
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
1 year ago
Rupert Wiser af6eabff53 Revert "Delete vpython, leaving only vpython3."
This reverts commit db0dcbbe7c.

Reason for revert: `gclient sync` no longer works on my local checkout with this change due to the error `No such file or directory: 'vpython'.`.

Original change's description:
> Delete vpython, leaving only vpython3.
>
> Bug: 1376538
> Change-Id: Ia7795f75fd05db63f155c5feffcc43822fb45bb1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5187892
> Reviewed-by: Mike Frysinger <vapier@chromium.org>
> Commit-Queue: Brian Ryner <bryner@google.com>
> Reviewed-by: George Engelbrecht <engeg@google.com>
> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Chenlin Fan <fancl@chromium.org>

Bug: 1376538
Change-Id: I7c32eea1f8ae07644ab81a35213de5c68c64dfb6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5260042
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Reviewed-by: Andy Perelson <ajp@chromium.org>
Commit-Queue: Brian Ryner <bryner@google.com>
Reviewed-by: Brian Ryner <bryner@google.com>
1 year ago
Brian Ryner db0dcbbe7c Delete vpython, leaving only vpython3.
Bug: 1376538
Change-Id: Ia7795f75fd05db63f155c5feffcc43822fb45bb1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5187892
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Brian Ryner <bryner@google.com>
Reviewed-by: George Engelbrecht <engeg@google.com>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Chenlin Fan <fancl@chromium.org>
1 year ago
Garrett Beaty a95979fcc3 Update the CheckInfraFreeze canned check to use datetime & zoneinfo.
The current implementation of CheckInfraFreeze relies on timestamps
being preconverted to UNIX timestamps because zoneinfo doesn't work by
default on Windows. The necessary tzdata package has been added so that
zoneinfo will work for Windows, so switching to datetime and zoneinfo is
now possible and makes it easier to update the time range for freezes.

Bug: 1521396
Change-Id: I8db111f05db2e79f4fffd9da3829b9071d12163f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5246425
Commit-Queue: Garrett Beaty <gbeaty@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago
Garrett Beaty 2bc81cdf4f Add a canned check for enforcing infra freezes.
This will provide a single site that needs to be updated when setting
new dates for infra freezes rather than requiring copy-pasting timestamp
changes between multiple directories and repos.

Bug: 1515149
Change-Id: I62f7de45c3a7e993f558738a0ff1f2dae6cac471
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5160597
Reviewed-by: Gavin Mak <gavinmak@google.com>
Commit-Queue: Garrett Beaty <gbeaty@google.com>
1 year ago
Josip Sokcevic 31a99001bd Remove dead code
R=gavinmak@google.com

Change-Id: If27b290ebb575db5ec93b4abcb7f432bedd6f18a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5153638
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
1 year ago
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
Josip Sokcevic f2f8be1ca8 [pylint] Use correct variable name
pylintrc should have been used instead of pylint.

R=ddoman@google.com

Change-Id: Ia1cef7645119af0e938714acfca17b8b69d2cad8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5066856
Commit-Queue: Scott Lee <ddoman@chromium.org>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Josip Sokcevic a52cc055e4 pylint: Add pylint 2.17
R=ddoman@google.com

Change-Id: Ice31996ebf774259a902399712774006ff4627ee
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5062345
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
1 year ago
Josip Sokcevic 25b4354fad Revert "pylint: Add pylint 2.13"
This reverts commit 86c7f734f5.

Reason for revert: pylint 2.13 doesn't work well with py 3.11

Original change's description:
> pylint: Add pylint 2.13
>
> Bug: 1500415
> Change-Id: I05293251be810772c56530962ef5a33a0f0cc887
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5030756
> Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Brian Ryner <bryner@google.com>
> Reviewed-by: Scott Lee <ddoman@chromium.org>
> Commit-Queue: Scott Lee <ddoman@chromium.org>

Bug: 1500415
Bug: 1504663
Change-Id: I4a679422385767a1b78493f3a322b2a065d75d65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5055994
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Brian Ryner <bryner@google.com>
Commit-Queue: Brian Ryner <bryner@google.com>
1 year ago
Josip Sokcevic 86c7f734f5 pylint: Add pylint 2.13
Bug: 1500415
Change-Id: I05293251be810772c56530962ef5a33a0f0cc887
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5030756
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Brian Ryner <bryner@google.com>
Reviewed-by: Scott Lee <ddoman@chromium.org>
Commit-Queue: Scott Lee <ddoman@chromium.org>
1 year ago
Daniel Cheng 8f761f5795 Mention updating inclusive language excluded directories for 3p code.
In an ideal world, exclusions to this check would never be needed, but
for third-party code, fixing this can often be non-trivial (e.g. it
might involve renaming git branches and fixing CI infrastructure).

Change-Id: I7e27f5a65fce0d8356765b58474c23321d1cf361
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4944933
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
1 year ago
Alexei Svitkine a51863b2f8 Fix missing \n in an error message.
Change-Id: Icd567773f56b977afd7725f9ecfff51311ef381f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4937211
Auto-Submit: Alexei Svitkine <asvitkine@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
1 year ago
Joanna Wang 6aed4f5a0c Clarify that gclient gitmodules' changes need to be committed.
Bug: 1483198
Change-Id: I1dfae06bfc273b01d168b507861984327ad0d629
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4892468
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Joanna Wang <jojwang@chromium.org>
1 year ago
Yuanjun Huang 5dffbd43c4 [config] change to use luci-config v2 in presubmit
In `CheckChangedLUCIConfigs`, it will call luci-config to list all
config sets. Change that call to v2.

Change-Id: I7a00d157fa631174b2124f0920026fa6b1fea04c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4900076
Commit-Queue: Yuanjun Huang <yuanjunh@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
1 year ago
Maggie Chen 34e0ecf20e Change from PresubmitError to PresubmitWarning for bad license
We cannot distinguish if this is a moved third-party file. So just
do warnings for a license header from a third-party company.

Bug: 1462922
Change-Id: I78394dcccb9028bce6c535dfce625364dd29157b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4895337
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Commit-Queue: Maggie Chen <magchen@chromium.org>
1 year ago
Gavin Mak f936d540e1 Remove __future__ imports
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>
1 year ago
Yiwei Zhang 7a69b031d5 presubmit: support checking new TODO format
R=sokcevic

Bug: 1479023
Change-Id: I6eabb16447526fbc8de83b823763888aff1a8249
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4847314
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
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
Gavin Mak a94d8feecb Drop py2 support in presubmit files
python3 is the only supported version of python in depot_tools.

Bug: 1475402
Change-Id: I62ef9979a57bedc3be6886239068de5cd73f0504
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4814439
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
2 years ago
Josip Sokcevic 6308837868 Reland "Check if DEPS git is not in git submodules"
This is a reland of commit e6f40ea034

Original change's description:
> Check if DEPS git is not in git submodules
>
> If a new git dependency is added to DEPS file, presubmit check should
> fail if there's no corresponding git submodule entry if git_dependencies
> is set to SYNC.
>
> R=jojwang@google.com
>
> Bug: 1476115
> Change-Id: I0fdebb036c129c2f97524b86ee4d70c07e5b0091
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4818792
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>

R=jojwang@google.com

Bug: 1476115
Change-Id: I4cd6e541aabb5d8be883e15e5693c4ad9085bcad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4825584
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
2 years ago
Anne Redulla b9d7c85582 [ssci] Added CheckChromiumDependencyMetadata in presubmit_canned_checks
This CL adds a new function `CheckChromiumDependencyMetadata` in
`presubmit_canned_checks.py`. It can be used to check that files satisfy
the format defined by `README.chromium.template`
(https://chromium.googlesource.com/chromium/src/+/main/third_party/README.chromium.template).

The code for metadata validation can be found in `//metadata`. Note that
all metadata validation issues will be returned as warnings only for
now, while the quality of metadata is being uplifted.


Bug: b:277147404
Change-Id: Iacf1b3a11219ab752549f6dc6e882c93c0fbe780
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4812578
Commit-Queue: Anne Redulla <aredulla@google.com>
Reviewed-by: Rachael Newitt <renewitt@google.com>
Reviewed-by: Gavin Mak <gavinmak@google.com>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
2 years ago
Josip Sokcevic 6c8d2a9ce5 Revert "Check if DEPS git is not in git submodules"
This reverts commit e6f40ea034.

Reason for revert: infra and angle have git dependencies with
no gitlink.

Original change's description:
> Check if DEPS git is not in git submodules
>
> If a new git dependency is added to DEPS file, presubmit check should
> fail if there's no corresponding git submodule entry if git_dependencies
> is set to SYNC.
>
> R=jojwang@google.com
>
> Bug: 1476115
> Change-Id: I0fdebb036c129c2f97524b86ee4d70c07e5b0091
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4818792
> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
> Reviewed-by: Joanna Wang <jojwang@chromium.org>

Bug: 1476115
Change-Id: Id990407f1738ac1e3d3950e0a85e9e39f8f1b624
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4820455
Auto-Submit: Josip Sokcevic <sokcevic@chromium.org>
Commit-Queue: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
2 years ago
Josip Sokcevic e6f40ea034 Check if DEPS git is not in git submodules
If a new git dependency is added to DEPS file, presubmit check should
fail if there's no corresponding git submodule entry if git_dependencies
is set to SYNC.

R=jojwang@google.com

Bug: 1476115
Change-Id: I0fdebb036c129c2f97524b86ee4d70c07e5b0091
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4818792
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Joanna Wang <jojwang@chromium.org>
2 years ago