aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-10-06Merge Android 12android-t-preview-2android-t-preview-1android-t-beta-3android-s-v2-preview-2android-s-v2-preview-1android-s-v2-beta-3android-s-v2-beta-2android-s-qpr3-beta-1androidx-metrics-releaseandroid-t-preview-1android-s-v2-preview-1android-s-v2-beta-3android-s-qpr3-beta-1Xin Li
Bug: 202323961 Merged-In: I976aab264b5da4091d26c0ade453a0e8adaba5be Change-Id: I48a700bee04850458185184adf0d51e8ae3b9ea1
2021-09-22android_test_mapping_format: cleanup - "void" funcs don't need explicit ↵temp_sam_202323961Raman Tenneti
->None. am: b0a69d5d42 Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1832735 Change-Id: I976aab264b5da4091d26c0ade453a0e8adaba5be
2021-09-21android_test_mapping_format: cleanup - "void" funcs don't need explicit ->None.androidx-resourceinspection-releaseRaman Tenneti
Fixed import order. Bug: 196099793 Test: manual Tested: $ pylint tools/android_test_mapping_format.py Change-Id: If3b08adc2a16dde5132aebabf85adf75525c10ef
2021-09-02android_test_mapping_format: updated the code to match the internal version. ↵Raman Tenneti
am: 20ff9462ea Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1817396 Change-Id: I02a875c5f67441d7614db296d15e1465bb614999
2021-09-01android_test_mapping_format: updated the code to match the internal version.android-s-beta-5android-s-beta-5Raman Tenneti
Made changes to match the internal cl: cl/394099398 + Used the imperative language in the docstring. + Added typing for functions + Fixed pylint errors. + Added "_" to all globals. + Used f' strings + Small optimizations to the code to be more efficient. Bug: 196099793 Test: unittests pass Tested: $ pylint tools/android_test_mapping_format.py $ pylint tools/android_test_mapping_format_unittest.py $ pytest tools/android_test_mapping_format_unittest.py Change-Id: I9e8b4be2a6729762001f2e5cd266dccbb0b6f9e9
2021-07-28cpplint: switch to open source community fork am: 109ae1a1b8Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1771497 Change-Id: I693543c68d2423aab6526090edb19c596d272e6f
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-22utils: run: fix crash with failing tools & combined stderr am: 216334058fMike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1684226 Change-Id: I6cd59a72e03e5645efa256377d53132e4e0c365b
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-16lint: clean up newer pylint warnings am: 95795d8710Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1675674 Change-Id: Iab95d05c1542318c83c3dc82c63ba424e29a43ab
2021-04-15utils: run: fix file leakage with bad execs am: bfa656d588Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1675673 Change-Id: I3c43b2c82244555e4f3c2e389fc253beded24c13
2021-04-15utils: run: make sure exceptions always use strings for output am: a89a138097Mike Frysinger
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1675672 Change-Id: I3a55ae0b856938061254560267fd14723f7aab4b
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