Age | Commit message (Collapse) | Author |
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1553823
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: Ieb6bbd35340e91586d64ff522174c53a27016085
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1373920
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I8be1bd9e133bad65c2cf6a55ae3b60ef141d3200
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1515460
Change-Id: I7e38ffca92d04ddcce84ef12471dbbdb84ab4855
|
|
Bug: None
Test: added some slow hooks and reviewed the logged output
Change-Id: I19b024e995b564a12d929db2c5cf15a3e5a4a2b6
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1515081
Change-Id: Icb2d75c6ba4a2337f857540f83f94e8772821cd8
|
|
These are only used by Python 2 which we don't support.
Bug: None
Test: unittests pass
Change-Id: If5f26ca655ce58a9968eaa624424cf5186cf9625
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1504936
Change-Id: I7e8c7b223cd20bf54fbfc17ef6dc9f66cb3a3031
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1490697
Change-Id: I7734954e62f9a8b5ee53a064f341238b0af490e0
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1486482
Change-Id: I959401c88303f39673eb837873a9f2581a600c0c
|
|
We require Python 3 everywhere, so no point in this.
Bug: None
Test: unittests pass
Change-Id: If47bc351829610f7d7677f5255dc433ca1294079
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1408931
Change-Id: Ieb4c41d997b5ddd49d9f58a1f257e56e53456dd0
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1428528
Change-Id: Ie5f6a45ff10bffed2d6e1a2da1115cb2a8202c3a
|
|
re.Pattern was only introduced in Python 3.7.
Test: ./pre-upload
Bug: 168593718
Change-Id: I9dc685a8d1863808d9c475539a8f1fdbd96474d0
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1422908
Change-Id: I92a7234bfbfd5076856a51ccca953aa6889c4611
|
|
We did this for pylint already, so switch the rest too.
Bug: None
Test: running each tool with --help works
Change-Id: I0c6156cbcfabf2ebb7874cbb8a52059b1a88dfcc
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1395027
Change-Id: Ia33c2a2caf6d02259fb3b393157a08d7e5e64a3f
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1417624
Change-Id: I80c4a873c4e87b9936104d94e6723a72b3649341
|
|
No point in linting or testing when the code forces Python 3.6+.
Bug: None
Test: `repo upload` still works
Change-Id: I5af19b5dc70be3f5be99157d1fc4287e4437c553
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1413981
Change-Id: I929668c32fb13fa260cd12562f00b026fdff3d52
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1413980
Change-Id: Ie264829e1cbf047d0bc6af3cc021d42f4a304dc4
|
|
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
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1373921
Change-Id: I2f0e1d3939e10be0763b24ecc0b14118c1be048e
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409412
Change-Id: Id7ed769c4436ae3d316ad046d1c181fd316f60b3
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409411
Change-Id: I20b225c3916994aabf677b5fdc86c5f5dbdae60f
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409410
Change-Id: Ie20fc9502b2683e80f3f172255a4275c2131cfbf
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1409409
Change-Id: I17090f93848c0aaf47245df5a53ca3ce6aefc351
|
|
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
|
|
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
|
|
This matches the VALID_OPTIONS style, and will make follow up
refactors easier.
Bug: 160223496
Test: Unittests pass
Change-Id: I161e4b714a6faa3432588306e50ef02ab30763a2
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1399689
Change-Id: Ib0b684b692726004efd8859569e3a3f513078498
|
|
The rustfmt hook was relying on ${PREUPLOAD_FILES} which is only correct
when evaluating HEAD. Update the hook to parse the correct version of
the file.
Before 2.0, rustfmt does not support --check when passing the source via
stdin. Handle this case by comparing the input with the output and
report a command to fix the issue to the user.
Bug: 164111102
Test: Added multiples changes to system/security (typo and incorrect
indentation). Run pre-upload.py manually.
Change-Id: Ibd1bfcb9e630f0b21abfb1e1feb1248fcddf2236
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1401348
Change-Id: I5f8d55c2c1cdcca60971fa8d6acc5164b2c10fdb
|
|
These provide better diagnostics & checking than Equal.
Bug: None
Test: unittests still pass
Change-Id: I0c34bc1dae6d32fa58cfe0c45414157b2363b1ee
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1383801
Change-Id: Ie063537cd26e5e967160b4878cca3b4c87b7c0e0
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1383803
Change-Id: Ie176a524ce0a8c77a8b7900cbc4f949a2fc4519a
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1383802
Change-Id: Ie436d3aa297c3410246571f7fe7c6ce2bdf7b3e4
|
|
Instead of using "git log <commit>^!", which means "perform a walk
that includes <commit> and excludes its parents", perform a
non-walking command.
We could use "git log --no-walk <commit>" for this. Instead, let's
use the lower-level "git diff-tree", to get into the habit of using
plumbing commands that try to support scripting by behaving simply and
predictably.
Noticed by code inspection.
Change-Id: I167e0920c0c0f67d9def1bdbdd34bd88941193a5
|
|
Otherwise, trying to upload a merge can fail with errors like
ValueError: Failed to parse diff output: ::100644 100644 100644 4d2b33a 4d2b33a d63fea7 MM BUILD
because "git diff <foo>^!" returns a diff against all parents
that DIFF_RE does not know how to parse.
Reported-by: Matthew Maurer <mmaurer@google.com>
Change-Id: Iafd846f083c0c078b383f7d48ad00cce896a404c
|
|
As a lower-level plumbing command designed for scripting, this can be
counted on to behave simply and predictably over time.
Change-Id: I628727686898a3fa5441a2dc58f9edb867d2aec7
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1375269
Change-Id: I07073b9adfb2f719906a8ec200f76bd5c1de91cb
|
|
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for
reference
Bug: 161896447
Test: None
Change-Id: I7c18212291d7bfe57a0452a3d317a90cedd079c5
|