Age | Commit message (Collapse) | Author |
|
Bug: 29606287
Test: read the message!
Change-Id: I11ca39ff4b5d6fa294e8ad822ca2ba671002679c
|
|
Similar to git-clang-format, google-java-format supports the --fix flag
and can trivially auto-fixup style violations.
Bug: None
Test: Ran hook
Change-Id: Ia9a9aaab1a56a7db68030c6ca20289ec88ac8aa6
|
|
This change adds support for hooks to provide a mechanism to
automatically fix any errors found in the hook's execution. This will
currently only be attempted if the commit in question is the topmost in
the list of commits to be sent (i.e. if it is HEAD) and there is a
single fix available (since multiple fixes might interact badly with
each other).
This change also adds automatic fix support for the clang-format hook.
Bug: 32570902
Test: clang-format can now auto-fix formatting
Change-Id: I9214b7eb88548481feb639d8f8e70b3f57913dc0
|
|
In the newest version of the formatter, imports are sorted by default.
This would normally be fine, except that AOSP has a defined order that
doesn't confirm to this style, which would lead to the formatter
requiring a lot of changes and possibly introducing conflicts without
a larger scale cleanup. So turn off this behavior.
Projects that would prefer to sort their imports may specify the
--sort-options arg in their PREUPLOAD.cfg files to revert to the
default google-java-format behavior.
Bug: 31552314
Test: Verified in local test repository
Change-Id: I9e2df57ef472e7f2d1d4e795ba63559c1aacac67
|
|
Bug: 31552314
Test: Verified hook on a test project; unit test
Change-Id: I1e4b2ff5f8285707d0fd3a4a14f65957fa21b273
|
|
This change adds REPO_LREV and REPO_RREV, both of which are set in `repo
forall`[1]. This also updates the doc for REPO_REMOTE to reflect the
reality since it does not always return the URL.
1: https://source.android.com/source/using-repo.html#forall
Bug: 33219807
Test: Added a pre-upload that called `env`, saw new fields.
Change-Id: Ifec0a3e05bc6832ead61baa5ccb0b5d2c29d948e
|
|
Make it easier for PREUPLOAD.cfg writers to access any of the replacement
vars in different contexts rather than making them section-specific.
Bug: 32317688
Test: a modified PREUPLOAD.cfg with $REPO_ROOT in Hook Scripts works
Test: ran the new hooks_unittest!
Change-Id: I20dac8eeff78ce4f062dbaf8f7354df420e82d7d
|
|
We shouldn't be using the host install gofmt, but the one in the tree
instead.
Bug: None
Test: repo upload w/Tool Path in GLOBAL-PREUPLOAD.cfg
Change-Id: Icfceaeea4b8a77c54b7d90c7d7efa233be4a46ae
|
|
When uploading merge-commits, git log will list commits that are not
necessarily uploaded (since they have usually been already committed to
another branch). In order to avoid developers skipping verification on
these cases, this change adds an option to the config file that will add
--first-parent to the git log invocation, so pre-upload checks are only
performed on the commits that the developer intended.
Bug: 31926893
Test: repo upload
Change-Id: I76959906ed05b5cd09c4263fb54997b55dd6cfc3
|
|
Bug: None
Test: manually checked output
Change-Id: Iecc20728622b00fd392ca9f761295ebfbe94e58f
|
|
Bug: None
Test: None
Change-Id: I01878de1d1e81953eba08a803a3d0abd72056161
|
|
We're given a perfectly good name in the custom hook configuration; use
it instead of basename(cmd[0]).
Bug: None
Test: pre-upload.py in here, and in bionic
Change-Id: I407d630fa3f2e6698c8dfadec4d443cc23719566
|
|
Bug: 29606287
Test: `repo upload` now explains why Test is required
Change-Id: Id17b07e59bf7c2fa0d3d267001c748bfef740f99
|
|
Bug: 29606287
Test: Test with an empty commit
Change-Id: I8091cdff654209247359c8a38b190823c4bc7a12
|
|
This way people can more cleanly control its path without having to
resort to the repohooks-internal flag "--executable-path".
Bug: 29133322
Test: repo upload here still works
Change-Id: Id5360a2f5da9dcd0d7aad6ead21eb66120f14db3
|
|
This is an exact copy of github version cloned at:
https://github.com/google/styleguide/tree/6d3a7d8a229e189f7a5bb7c3923363356625ece5/cpplint
Added ./cpplint-update to pull the new version of cpplint
from upstream.
Also updated the code for hooks.py to allow to specify
Tool Path for cpplint.
Bug: None
Test: `repo upload . --cbr` and ensured the hooks were executed
Change-Id: I37a0929c7db04df7ce17e1d1b43c99b9ac8dec82
|
|
This change adds a small wrapper that calls git-clang-format and prints
out any files that need attention.
Bug: 26800693
Test: Added clang_format builtin hook to a project, complained about
non-compliant files.
Change-Id: Id4431aaed4d17f6639a448fbddf1a595168cf27f
|
|
Look for GLOBAL-PREUPLOAD.cfg files in the root of the repo checkout and
in the manifests git repo. This way people can set up defaults that cover
all of the projects under this one manifest if they want.
Bug: 29606287
Test: put some config files in the common locations and saw their settings merged
Change-Id: I3fcecdf023cc49e89b952c46df2a52470d0c309a
|
|
Sometimes there just isn't a bug around, or it's not worth creating one.
Bug: None
Test: this commit is allowed to upload
Change-Id: I2e1a3e241cdaad35f2d6365b037d2c49d6453de6
|
|
This allows `git clang-format` to operate only on changed lines of a
commit, to gradually format files as they are modified.
Bug: 26800693
Test: git clang-format --style=file ${PRESUBMIT_COMMIT} works
Change-Id: I7629a3cf4138c52f149f2fe578f1519ae387ea14
|
|
This will allow custom hooks to perform checks on the commit message
in addition to the content of changed files.
BUG: None
Change-Id: I70ab8a570e5436bb90f061e1cc3174ebc5654e6b
|
|
Bug: 28531409
Test: made some changes to rng files and verified they were checked
Change-Id: I6fe2289348586916b6cec964ffedf0cbd5d362b8
|
|
Allows repos to enforce Test: fields in the commit message.
Bug: 28320587
Change-Id: If401e08d44e19b7068a71289f72dec129e912c71
|
|
This is useful for kernel developers who want to run their code through
checkpatch.pl for everything.
Bug: 28288284
Change-Id: If0b66c1daf04bbdc9c3047b9246a96dcd071fbc9
|
|
Allow repos to enforce Bug: and Change-Id: fields in the commit message.
We need to extract & plumb down the commit message to all the hooks now.
Bug: 28288284
Change-Id: I8c16e1e2d771569fb0721c135d41dbfeca44135c
|
|
We're going to want to start dumping some more helper tools in here
(like checkpatch and cpplint), so start a directory to hold these so
we don't dump them all in the top level directory.
Bug: 28288284
TEST=`repo upload` in this dir still runs python linter
Change-Id: Ic613d15635cf30cd3e7f940566a88407505cfa03
|
|
Sometimes the remote.<branch>.merge field is not set up to be fully
qualified. It's not entirely clear when/why this happens, but since
repo itself handles this scenario, improve the pre-upload hook so it
also works. We assume refs/heads/ is the implicit namespace as this
is what repo uses and is generally what everyone using git uses.
BUG=b:27812802
TEST=`repo upload` works w/merge=master & w/merge=refs/heads/master
Change-Id: I3e1fc728a61c8061791ce8f4138b8d565fb2c60f
|
|
The PRESUBMIT.cfg file used by CrOS has a slightly different syntax and
config names than the one used by AOSP. Trying to keep them compatible
is more pain than it's worth, so use the name "PREUPLOAD" instead w/AOSP.
This also avoids confusion with the term "presubmit" that exists on the
AOSP side today related to tests that run before a CL is submitted.
BUG=b:27793819
TEST=unittests pass
Change-Id: I7a3726c300f38475cc28128e87d09d6440ce3577
|
|
Much of this code is based on Chromium OS.
BUG=b/27503155
TEST=ran `repo upload` on a few repos by hand w/manifest changes
Change-Id: I1d65f121c67ef547c94eb7d6e495141e542ff6e8
|