Age | Commit message (Collapse) | Author |
|
androidx-enterprise-release
Change-Id: I87d87f6c508ef995b003388252edab413b1e68a5
|
|
We require Python 3 everywhere, so no point in this.
Bug: None
Test: unittests pass
Change-Id: If47bc351829610f7d7677f5255dc433ca1294079
|
|
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
|
|
re.Pattern was only introduced in Python 3.7.
Test: ./pre-upload
Bug: 168593718
Change-Id: I9dc685a8d1863808d9c475539a8f1fdbd96474d0
|
|
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
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1365079
Change-Id: I07696a11bac1fae9836cce41d3baff4dddf4058d
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1363256
Change-Id: Idef74a1004a90285c123c8359163fddda507935f
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1363136
Change-Id: I6218a1ec51ce8fc28202b379faa51d573a955b98
|
|
We've been emitting warnings about this for ~6 months, and our pylint
helper actually already requires Python 3.5, so require it in the main
script now too.
We still emit warnings for Python 3.5 being deprecated.
Bug: None
Test: `repo upload` still works w/Python 3.6
Change-Id: Ib78d3d6d082ba9bfd1a26ac582a93f1f088b304f
|
|
We don't support Python 2 at all. Warn anyone still using that
version so they need to migrate by end of year.
Bug: None
Test: `repo-1 upload` using python2 emits a warning
Change-Id: I8d7265399273086a7ac4151039e699277841be2e
|
|
|
|
To help people diagnose bad host environments, check for Python 3
compatibility all the time with pylint3=True.
Bug: 161198640
Test: `repo upload` with python2-only pylint emits a warning
Change-Id: I856cd3d81557cedab28d21e83bcba83920abf4df
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1344736
Change-Id: I38cfd364bf23c3ac851d66b4a6d6f87f62bcc9ce
|
|
The current (incorrect) regex only enforces a Relnote
tag for current.txt files in the root directory of the
repo. However, current.txt can be in any repo subdirectory,
so we need to enforce it everywhere.
This change removes the up carrot in the regex that
enforces matches must start at the line start.
Bug: 159449967
Test: ./pre-upload.py (with commit_msg_relnote_for_current_txt = true)
Change-Id: I7555398df6edaf410af60ce0def05894ef53ea11
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1274027
Change-Id: Icd6bbf51132eff965b966bc195ad05ab11db307a
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1315257
Change-Id: Icf32a67ac7a053f7ca3b160d33ee9c7fd327845b
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1312703
Change-Id: I05a3b213888f23df3f60c8a0355bd5d3845639a1
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1312702
Change-Id: Ifc34cbe6d6dee84f7e2ca27ab48a9fcc6e77aded
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1294805
Change-Id: I7abaa949416092ef8314725dc749a2b6a68472df
|
|
Original change: https://android-review.googlesource.com/c/platform/tools/repohooks/+/1293391
Change-Id: I48266f5b64979527b7ddf0ab25b6c73c17bf8359
|