aboutsummaryrefslogtreecommitdiff
path: root/rh
AgeCommit message (Collapse)Author
2017-02-17drop "Android" from the Test error messageandroid-o-preview-1o-previewMike Frysinger
Bug: 29606287 Test: read the message! Change-Id: I11ca39ff4b5d6fa294e8ad822ca2ba671002679c
2016-12-22Add support for automatic fixups to google-java-formatLuis Hector Chavez
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
2016-12-22Add support for automatically applying fixesLuis Hector Chavez
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
2016-12-16Pass --skip-sorting-imports to google-java-format.Jeff Davidson
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
2016-12-15Add a builtin repo hook to run google-java-format.Jeff Davidson
Bug: 31552314 Test: Verified hook on a test project; unit test Change-Id: I1e4b2ff5f8285707d0fd3a4a14f65957fa21b273
2016-11-30Add more environment variablesLuis Hector Chavez
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
2016-10-21unify helper vars across all sectionsMike Frysinger
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
2016-10-20Add Tool Path for gofmtDan Willemsen
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
2016-10-17Add an option to ignore merged commitsLuis Hector Chavez
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
2016-10-06Print status of hooks as they're being run.Josh Gao
Bug: None Test: manually checked output Change-Id: Iecc20728622b00fd392ca9f761295ebfbe94e58f
2016-09-30Fix typo in docstring.Josh Gao
Bug: None Test: None Change-Id: I01878de1d1e81953eba08a803a3d0abd72056161
2016-09-26hooks: use the provided name for custom hooks.Josh Gao
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
2016-09-16Add a better description of why users should include Test in messages.David James
Bug: 29606287 Test: `repo upload` now explains why Test is required Change-Id: Id17b07e59bf7c2fa0d3d267001c748bfef740f99
2016-09-16Handle empty commits in repohooks.David James
Bug: 29606287 Test: Test with an empty commit Change-Id: I8091cdff654209247359c8a38b190823c4bc7a12
2016-09-15pylint: add a tools path config for itMike Frysinger
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
2016-09-15Add cpplint.py to be used in preupload repo hooksAlex Vakulenko
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
2016-09-08hooks: Add a first-approximation clang-format hookLuis Hector Chavez
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
2016-09-08config: enable loading of project wide defaultsMike Frysinger
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
2016-09-03hooks: bug: allow NoneMike Frysinger
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
2016-09-02hooks: Add PRESUBMIT_COMMIT to the custom hook optionsLuis Hector Chavez
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
2016-05-03Add PRESUBMIT_COMMIT_MESSAGE to the env.Nicolas Sylvain
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
2016-05-02hooks: xmllint: check rng filesMike Frysinger
Bug: 28531409 Test: made some changes to rng files and verified they were checked Change-Id: I6fe2289348586916b6cec964ffedf0cbd5d362b8
2016-04-21hooks: add a 'Test: ' commit message hookSteve Fung
Allows repos to enforce Test: fields in the commit message. Bug: 28320587 Change-Id: If401e08d44e19b7068a71289f72dec129e912c71
2016-04-21hooks: add a checkpatch.pl hookMike Frysinger
This is useful for kernel developers who want to run their code through checkpatch.pl for everything. Bug: 28288284 Change-Id: If0b66c1daf04bbdc9c3047b9246a96dcd071fbc9
2016-04-21hooks: add some commit message hooksMike Frysinger
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
2016-04-20tools: start a directory to hold various tools/wrappersMike Frysinger
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
2016-04-04git: make remote parsing a bit more robustMike Frysinger
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
2016-04-04rename config file to PREUPLOAD.cfgMike Frysinger
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
2016-03-10initial importMike Frysinger
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