aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-07-26cpplint: switch to open source community forkandroidx-wear-wear-remote-interactions-releaseandroidx-wear-wear-phone-interactions-releaseandroidx-wear-wear-ongoing-releaseMike Frysinger
The Google open source version doesn't support Python 3, and it doesn't seem like it'll be fixed any time soon. Switch to the forked version that is maintained by the community as it supports Python 3. Bug: 185115831 Test: upload tests pass No-Typo-Check: imported code Change-Id: I4c8d448f1e80296e5fcce7278eadbd9a80885e67
2021-04-21utils: run: fix crash with failing tools & combined stderrandroid-s-beta-4android-s-beta-3android-s-beta-2android-s-beta-1android-s-beta-4Mike Frysinger
If we try to run a program that doesn't exist, don't crash while trying to show the errors to the user. Bug: 185946409 Test: pre-upload unittests pass Change-Id: I70e00412bd000e907536011d245eaa82d36634f6
2021-04-14lint: clean up newer pylint warningsMike Frysinger
Bug: None Test: `repo upload` doesn't flag anything Change-Id: I404e6694bf2ce9705f4aa96d9e4801780407e4df
2021-04-14utils: run: fix file leakage with bad execsMike Frysinger
Minor issue that doesn't normally show up, but should still make sure we explicitly close these handles so the resource trackers don't warn. Bug: 185196437 Test: unittests pass Change-Id: I6e64a10243c2d20245e37d090e1c167067f0f13c
2021-04-14utils: run: make sure exceptions always use strings for outputMike Frysinger
We force the returned value to use strings for stdout/stderr, but the exceptions thrown here don't do that. We only catch the exception in two places when the underlying command fails, so we rarely hit this code path. Add more unittests to make sure it works. Bug: 185196437 Test: unittests pass Test: repo upload in a project w/clang_format enabled & no /usr/bin/python works Change-Id: Ic29c5dbd324a24333d99a500cc82913ae7bea93a
2021-02-05android_test_mapping_format: drop Python 2 support am: f1e0b3bf4ftemp_ab_7272582androidx-leanback-releaseMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1570580 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I16d6ba29799efe3db4918d3bf8163d4d2e0b8100
2021-02-02android_test_mapping_format: drop Python 2 supportandroid-s-preview-1Mike Frysinger
Bug: None Test: unittests pass Change-Id: Ib34c1ade62a139080aaca1e0972e84a0a53ab2d1
2021-02-02config: switch to stdlib get() fallback logic am: 42e4aa4f4cMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1567662 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I277a33975d2cfc201511a615d3d9e9d46a3eba69
2021-02-01utils: drop Python 2 support am: d57f9c5ac9Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1566818 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I66906372a09f619036ebc74bae6b67fc338080e8
2021-02-01config: switch to stdlib get() fallback logicMike Frysinger
Python 3's configparser has a better get() API that has equivalent functionality as the default logic we implemented. Switch to it. Bug: None Test: all unittests pass Change-Id: Ie9698351f6d7bc108c3e93b642dac9b6ca8ed78d
2021-01-30config: drop Python 2 support am: 8349d896cdMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1566558 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I51a5fd172058f876da8dcf0e177a8b8ac246e6c7
2021-01-29utils: drop Python 2 supportMike Frysinger
Bug: None Test: unittests pass Change-Id: I557d84808934455642026b280992cddc0c7028d7
2021-01-29config: drop Python 2 supportMike Frysinger
Bug: None Test: unittests still pass Change-Id: Ia809f1b8e84bdf0469977f687815a210e600becb
2021-01-21Add aidl-format as a new builtin hook am: 147b6c35e1android-mainline-12.0.0_r5android-mainline-12.0.0_r4android-mainline-12.0.0_r39android-mainline-12.0.0_r36android-mainline-12.0.0_r22android-mainline-12.0.0_r19android-12.0.0_r32android-12.0.0_r29android-12.0.0_r28android-12.0.0_r27android-12.0.0_r26android-12.0.0_r21android-12.0.0_r20android-12.0.0_r19android-12.0.0_r18android-12.0.0_r16android12-qpr1-releaseandroid12-qpr1-d-s3-releaseandroid12-qpr1-d-s2-releaseandroid12-qpr1-d-s1-releaseandroid12-qpr1-d-releaseandroid12-devandroid12--mainline-releaseJiyong Park
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1553823 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: Ieb6bbd35340e91586d64ff522174c53a27016085
2021-01-21Add aidl-format as a new builtin hookJiyong Park
aidl-format formats AIDL files. Bug: 144540481 Test: Add `aidl_format = true` to /system/tools/aidl/REUPLOAD.cfg, make a poorly formatted change in one of the AIDL file in the repo. Creating a commit and executing `repo upload` caught it and did an automatic fixup. [FAILED] aidl_format FILES: ('tests/android/aidl/tests/ITestService.aidl',) 17,18d16 ... [RUNNING 5/5] aidl_format An automatic fix can be attempted for the "aidl_format" hook. Do you want to run it? (Yes/no)? yes Fix successfully applied. Amend the current commit before attempting to upload again. [FAILED] repohooks for platform/system/tools/aidl failed in 10.274s FATAL: Preupload failed due to above error(s). Change-Id: I3081360840dfbe989908cdffe189573799fc29ab
2021-01-06pre-upload/pylint: drop support for Python 3.5 am: 2729e11af0Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1373920 MUST ONLY BE SUBMITTED BY AUTOMERGER Change-Id: I8be1bd9e133bad65c2cf6a55ae3b60ef141d3200
2020-12-12pre-upload/pylint: drop support for Python 3.5Mike Frysinger
We've been emitting warnings about this for almost a year. Bug: None Test: `repo upload` still works w/Python 3.6 Change-Id: Iaead2a48ac125749176925302bf32e655384c965
2020-12-05pre-upload: warn whenever a hook is too slow am: 8f1ceeb31dMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1515460 Change-Id: I7e38ffca92d04ddcce84ef12471dbbdb84ab4855
2020-12-01pre-upload: warn whenever a hook is too slowMike Frysinger
Bug: None Test: added some slow hooks and reviewed the logged output Change-Id: I19b024e995b564a12d929db2c5cf15a3e5a4a2b6
2020-12-01drop file coding & print_function import am: 6c6f9ee983Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1515081 Change-Id: Icb2d75c6ba4a2337f857540f83f94e8772821cd8
2020-12-01drop file coding & print_function importMike Frysinger
These are only used by Python 2 which we don't support. Bug: None Test: unittests pass Change-Id: If5f26ca655ce58a9968eaa624424cf5186cf9625
2020-11-19Fix issue with triple quoted relnotes am: fc3ee954f2Nick Anthony
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1504936 Change-Id: I7e8c7b223cd20bf54fbfc17ef6dc9f66cb3a3031
2020-11-19Fix issue with triple quoted relnotesNick Anthony
This accounts for the case where we use triple quotes, but check for singular quotes. Triple quotes are supported, so we need to make sure we account for them when checking correctness. This also fixes a triple quote use case that is technically correct, but not supported. Bug: 173702182 Test: ./hooks_unittest.py Change-Id: I0b6e6deeac0addc3939b27db36a6ba47ff4bd2da
2020-11-16Add checking for unescaped quotes in a Relnote tag am: 2f5ba44e26Nick Anthony
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1490697 Change-Id: I7734954e62f9a8b5ee53a064f341238b0af490e0
2020-11-06Add checking for unescaped quotes in a Relnote tagNick Anthony
Because we need the quotes to check for starting and ending Relnote tags, having unescaped quotes in the release note causes the parsing to truncate at that unescaped release note. So the following scenarios will now be disallowed: Relnote: There are "quotes" in this relnote. Relnote: "There are "quotes" in this relnote." Relnote: "There are unescaped quotes in the second half of this "sentence"." Bug: 172663867 Test: ./pre-upload.py Change-Id: Idc3769eab64aff7455453b9d50317e0d0cad2a44
2020-11-04sixish: delete Python 2/3 compat module am: 737bf2785dMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1486482 Change-Id: I959401c88303f39673eb837873a9f2581a600c0c
2020-11-03sixish: delete Python 2/3 compat moduleMike Frysinger
We require Python 3 everywhere, so no point in this. Bug: None Test: unittests pass Change-Id: If47bc351829610f7d7677f5255dc433ca1294079
2020-10-20Add support for automatic fixups to gofmt. am: 239625cee5Liz Kammer
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1408931 Change-Id: Ieb4c41d997b5ddd49d9f58a1f257e56e53456dd0
2020-10-20Add support for automatic fixups to gofmt.androidx-print-releaseLiz Kammer
gofmt -w writes the gofmt result to the source file for the files that gofmt reports issues. Bug: 116112526 Test: ran hook for gofmt can now auto-fix formatting Change-Id: Ic676a588a567fbe5cf3f7a1411ac8048bde2af06
2020-09-17hooks: support Python 3.6 for ExclusionScope am: 573d316aa2android-mainline-11.0.0_r35android-11.0.0_r30android11-qpr1-c-releaseThiébaud Weksteen
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1428528 Change-Id: Ie5f6a45ff10bffed2d6e1a2da1115cb2a8202c3a
2020-09-16hooks: support Python 3.6 for ExclusionScopeThiébaud Weksteen
re.Pattern was only introduced in Python 3.7. Test: ./pre-upload Bug: 168593718 Change-Id: I9dc685a8d1863808d9c475539a8f1fdbd96474d0
2020-09-09tools: switch all our tools to python3 shebang am: 5be91ca1c2Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1422908 Change-Id: I92a7234bfbfd5076856a51ccca953aa6889c4611
2020-09-09tools: switch all our tools to python3 shebangMike Frysinger
We did this for pylint already, so switch the rest too. Bug: None Test: running each tool with --help works Change-Id: I0c6156cbcfabf2ebb7874cbb8a52059b1a88dfcc
2020-09-08Add [Builtin Hooks Exclude Paths] section am: ea52820de8Thiébaud Weksteen
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1395027 Change-Id: Ia33c2a2caf6d02259fb3b393157a08d7e5e64a3f
2020-09-02Add [Builtin Hooks Exclude Paths] sectionThiébaud Weksteen
There is currently no convenient option to enable a hook globally if some projects will fail the processing. The recommended setup is to enable the hook within each project's repository (using PREUPLOAD.cfg). This creates inconsistencies for large codebase. Adds a new configuration section to explicitly exclude some projects during the processing of a hook. The intent of this change is to enable rustfmt globally in AOSP, except for some paths (e.g. external/, vendor/). Test: Modified GLOBAL-PREUPLOAD.cfg to enable the new option, manually creates changes and review output of pre-upload.py Bug: 160223496 Change-Id: I94dbbf0ce2e6b58c4d4b4fc89c56a2a87543d878
2020-09-02drop python2 testing entirely am: ec4cdcbeeeMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1417624 Change-Id: I80c4a873c4e87b9936104d94e6723a72b3649341
2020-09-02drop python2 testing entirelyMike Frysinger
No point in linting or testing when the code forces Python 3.6+. Bug: None Test: `repo upload` still works Change-Id: I5af19b5dc70be3f5be99157d1fc4287e4437c553
2020-09-01config: refactor PreUploadSettingsTests am: 324296b110Thiébaud Weksteen
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1413981 Change-Id: I929668c32fb13fa260cd12562f00b026fdff3d52
2020-09-01config: add {Local,Global}PreUploadFile classes am: c9ba009aabThiébaud Weksteen
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1413980 Change-Id: Ie264829e1cbf047d0bc6af3cc021d42f4a304dc4
2020-09-01config: refactor PreUploadSettingsTestsThiébaud Weksteen
PreUploadFileTests and PreUploadSettingsTests share the same setup and teardown for writing configuration files. Extract that behaviour into a new class (FileTestsBase). Test: pre-upload.py Bug: 160223496 Change-Id: I8b572cdb0f43ae4557323a43a69e66ead67d87fe
2020-09-01config: add {Local,Global}PreUploadFile classesThiébaud Weksteen
Creates 2 new classes to differentiate local (PREUPLOAD.cfg) and global (GLOBAL-PREUPLOAD.cfg) files. While not useful yet, this allows to implement validation that is specific to local files. Ideally, PreUploadFile would be declared as @abstractclass but the support for py2/py3 makes this constraint tedious to implement. Test: pre-upload.py Bug: 160223496 Change-Id: I75e0e644f713002f1ba50a405965362c1c5a7589
2020-08-31pre-upload: drop support for Python 2 am: 7698778fb0Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1373921 Change-Id: I2f0e1d3939e10be0763b24ecc0b14118c1be048e
2020-08-31pre-upload: drop support for Python 2Mike Frysinger
Repo itself has been warning about Python 2 support for over a year, while pre-uplooad has been warning for about a month. We don't actually rip out any code (yet) to make sure this sticks in case we have to revert things temporarily. Bug: None Test: `repo upload` still works w/Python 3.6 Change-Id: Ia00bc3c9a59b0e6828df2691f47c6da94adb8038
2020-08-27config: refactor file management am: 1baec120bfMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409412 Change-Id: Id7ed769c4436ae3d316ad046d1c181fd316f60b3
2020-08-27config: refactor file managementMike Frysinger
The existing config management started out with just one file, but has grown to load & merge from multiple sources. Refactor classes to better reflect this: one class to represent a single file, and another to represent the union of them all. By itself, this isn't interesting. But it lays the groundwork to be able to load config files from subdirs instead of only one file per project. Bug: 160223496 Test: Unittests pass Change-Id: I522b18fa8bc31f787c92cf95db7da4168007915e
2020-08-26config: add Python 3 compat APIs am: 41a1fd1aacMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409411 Change-Id: I20b225c3916994aabf677b5fdc86c5f5dbdae60f
2020-08-25config: fix handling of optional args am: 0d0796a3eaMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409410 Change-Id: Ie20fc9502b2683e80f3f172255a4275c2131cfbf
2020-08-25config: pull valid sections into a class constant am: 3798d7e067Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409409 Change-Id: I17090f93848c0aaf47245df5a53ca3ce6aefc351
2020-08-25config: add Python 3 compat APIsMike Frysinger
Extend the items API to be like Python 3 with an optional |section|, and add a read_dict API for Python 2 that matches Python 3. We'll use both of these in the next commit. Bug: 160223496 Test: Unittests pass Change-Id: I2b9cb987ae25f852f86427dccb18e10fe80a35da
2020-08-25config: fix handling of optional argsMike Frysinger
The current logic only works for a single optional arg, and the counts are off by one atm (for reporting). Rework the logic to simplify and so a follow up change is easier to extend. Bug: 160223496 Test: Unittests pass Change-Id: Ibcb9e159486620c9e69312ed47ba9063cf2477b9