[git_cl] Fix some type checking errors

Bug: b/351071334
Change-Id: I15b8c7658c5959dbf88168e278525c2b8e2e4b2e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5754255
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Allen Li <ayatane@chromium.org>
1 file changed
tree: 61ec5b3e1e7059fc20b4be3fe51d53012f73d5fd
  1. bootstrap/
  2. fetch_configs/
  3. hooks/
  4. infra/
  5. man/
  6. metadata/
  7. python-bin/
  8. python2-bin/
  9. recipes/
  10. testing_support/
  11. tests/
  12. third_party/
  13. win_toolchain/
  14. zsh-goodies/
  15. .cipd_impl.ps1
  16. .flake8
  17. .gitattributes
  18. .gitignore
  19. .isort.cfg
  20. .style.yapf
  21. .vpython3
  22. auth.py
  23. autoninja
  24. autoninja.bat
  25. autoninja.py
  26. bazel.py
  27. bb
  28. bb.bat
  29. black
  30. bootstrap_python3
  31. breakpad.py
  32. BUILD_OWNERS
  33. build_telemetry
  34. build_telemetry.bat
  35. build_telemetry.py
  36. cipd
  37. cipd.bat
  38. cipd_bin_setup.bat
  39. cipd_bin_setup.sh
  40. cipd_client_version
  41. cipd_client_version.digests
  42. cipd_manifest.txt
  43. cipd_manifest.versions
  44. cipd_manifest_cros_python2.txt
  45. cipd_manifest_cros_python2.versions
  46. clang-format
  47. clang-format.bat
  48. clang_format.py
  49. codereview.settings
  50. compile_single_file
  51. compile_single_file.bat
  52. compile_single_file.py
  53. cpplint.bat
  54. cpplint.py
  55. cpplint_chromium.py
  56. cros
  57. CROS_OWNERS
  58. cros_python2.vpython
  59. detect_host_arch.py
  60. DIR_METADATA
  61. dirmd
  62. dirmd.bat
  63. download_from_google_storage
  64. download_from_google_storage.bat
  65. download_from_google_storage.py
  66. ensure_bootstrap
  67. fetch
  68. fetch.bat
  69. fetch.py
  70. gclient
  71. gclient-new-workdir.py
  72. gclient.bat
  73. gclient.py
  74. gclient_completion.sh
  75. gclient_eval.py
  76. gclient_paths.py
  77. gclient_scm.py
  78. gclient_utils.py
  79. gerrit_client.py
  80. gerrit_util.py
  81. git-cache
  82. git-cl
  83. git-credential-luci
  84. git-credential-luci.bat
  85. git-crrev-parse
  86. git-drover
  87. git-find-releases
  88. git-footers
  89. git-freeze
  90. git-gs
  91. git-hyper-blame
  92. git-map
  93. git-map-branches
  94. git-mark-merge-base
  95. git-nav-downstream
  96. git-nav-upstream
  97. git-new-branch
  98. git-number
  99. git-rebase-update
  100. git-rename-branch
  101. git-reparent-branch
  102. git-retry
  103. git-runhooks
  104. git-squash-branch
  105. git-squash-branch-tree
  106. git-thaw
  107. git-upstream-diff
  108. git_auth.py
  109. git_cache.py
  110. git_cl.py
  111. git_cl_completion.sh
  112. git_common.py
  113. git_completion.sh
  114. git_dates.py
  115. git_find_releases.py
  116. git_footers.py
  117. git_freezer.py
  118. git_hyper_blame.py
  119. git_map.py
  120. git_map_branches.py
  121. git_mark_merge_base.py
  122. git_nav_downstream.py
  123. git_new_branch.py
  124. git_number.py
  125. git_rebase_update.py
  126. git_rename_branch.py
  127. git_reparent_branch.py
  128. git_retry.py
  129. git_squash_branch.py
  130. git_squash_branch_tree.py
  131. git_upstream_diff.py
  132. gn
  133. gn.bat
  134. gn.py
  135. gn_helper.py
  136. google-java-format
  137. google-java-format.bat
  138. google_java_format.py
  139. gsutil.py
  140. gsutil.py.bat
  141. gsutil.vpython3
  142. isort
  143. led
  144. led.bat
  145. LICENSE
  146. lockfile.py
  147. luci-auth
  148. luci-auth.bat
  149. LUCI_OWNERS
  150. lucicfg
  151. lucicfg.bat
  152. mac_toolchain
  153. metrics.py
  154. metrics.README.md
  155. metrics_utils.py
  156. my_activity.py
  157. newauth.py
  158. ninja
  159. ninja.bat
  160. ninja.py
  161. ninjalog_uploader.py
  162. OWNERS
  163. owners_client.py
  164. owners_finder.py
  165. pinpoint
  166. pinpoint.bat
  167. post_build_ninja_summary.py
  168. PRESUBMIT.py
  169. presubmit_canned_checks.py
  170. presubmit_diff.py
  171. presubmit_support.py
  172. prpc
  173. prpc.bat
  174. pylint-2.17
  175. pylint-2.17.bat
  176. pylint-2.6
  177. pylint-2.6.bat
  178. pylint-2.7
  179. pylint-2.7.bat
  180. pylint_main.py
  181. pylintrc
  182. pylintrc-2.17
  183. python_runner.sh
  184. rdb
  185. rdb.bat
  186. rdb_wrapper.py
  187. README.gclient.md
  188. README.git-cl.md
  189. README.md
  190. reclient_helper.py
  191. RECLIENT_OWNERS
  192. reclientreport
  193. reclientreport.bat
  194. reclientreport.py
  195. repo
  196. repo_launcher
  197. roll-dep
  198. roll-dep.bat
  199. roll_dep.py
  200. rustfmt.py
  201. scm.py
  202. setup_color.py
  203. siso
  204. siso.bat
  205. siso.py
  206. split_cl.py
  207. subcommand.py
  208. subprocess2.py
  209. swift-format
  210. swift_format.py
  211. update_depot_tools
  212. update_depot_tools.bat
  213. update_depot_tools_toggle.py
  214. upload_metrics.py
  215. upload_to_google_storage.py
  216. upload_to_google_storage_first_class.py
  217. utils.py
  218. vpython3
  219. vpython3.bat
  220. WATCHLISTS
  221. watchlists.py
  222. whitespace.txt
  223. win32imports.py
  224. yapf
  225. yapf.bat
README.md

depot_tools

Tools for working with Chromium development. It requires python 3.8.

Tools

The most important tools are:

  • fetch: A gclient wrapper to checkout a project. Use fetch --help for more details.
  • gclient: A meta-checkout tool. Think repo or git submodules, except that it support OS-specific rules, e.g. do not checkout Windows only dependencies when checking out for Android. Use gclient help for more details and README.gclient.md.
  • git cl: A code review tool to interact with Rietveld or Gerrit. Use git cl help for more details and README.git-cl.md.
  • roll-dep: A gclient dependency management tool to submit a dep roll, updating a dependency to a newer revision.

There are a lot of git utilities included.

Updating

depot_tools updates itself automatically when running gclient tool. To disable auto update, set the environment variable DEPOT_TOOLS_UPDATE=0 or run ./update_depot_tools_toggle.py --disable.

To update package manually, run update_depot_tools.bat on Windows, or ./update_depot_tools on Linux or Mac.

On Windows only, running gclient will install git and python.

Contributing

To contribute change for review:

git new-branch <somename>
# Hack
git add .
git commit -a -m "Fixes goat teleporting"
# find reviewers
git cl owners
git log -- <yourfiles>

# Request a review.
git cl upload -r reviewer1@chromium.org,reviewer2@chromium.org --send-mail

# Edit change description if needed.
git cl desc

# If change is approved, flag it to be committed.
git cl set-commit

# If change needs more work.
git rebase-update
...
git cl upload -t "Fixes goat teleporter destination to be Australia"

See also open bugs, open reviews, forum or report problems.

cpplint.py

Until 2018, our cpplint.py was a copy of the upstream version at https://github.com/google/styleguide/tree/gh-pages/cpplint. Unfortunately, that repository is not maintained any more. If you want to update cpplint.py in depot_tools, just upload a patch to do so. We will figure out a long-term strategy via issue https://crbug.com/916550.

Note that the cpplint.py here is also used by the Tricium analyzer, so if the cpplint.py here changes, we should also update the copy used there.