Having a standard tool for formatting saves reviewers' valuable time.
google-java-format is Google's standard formatter and is somewhat
inspired by gofmt[1]. This commit formats everything using
google-java-format version 1.2.
The downside of this one-off formatting is breaking blame. This can be
somewhat hacked around with a tool like git-hyper-blame[2], but it's
definitely not optimal until/unless this kind of feature makes its way
to git core.
Not in this change:
* Tool support, e.g. Eclipse. The command must be run manually [3].
* Documentation of best practice, e.g. new 100-column default.
[1] https://talks.golang.org/2015/gofmt-en.slide#3
[2] https://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/git-hyper-blame.html
[3] git ls-files | grep java$ | xargs google-java-format -i
Change-Id: Id5f3c6de95ce0b68b41f0a478b5c99a93675aaa3
Signed-off-by: David Pursehouse <dpursehouse@collab.net>
This configuration file is not in sync with the latest version
of pylint, and is not (as far as I am aware) being used by anyone.
Change-Id: Ia397f359f6ccd72244586f960e5b3c7838c68f54
The script generated only users with the same first name. In
addition, only one change was created per user. In order to be able to
test whether users can be found by their first name, different first
names are used now. For each of those users, 1 to 5 changes are
created to reflect a more natural user base, on which statistics
don't yield the same values for all users. As we don't want to
possibly specify valid gmail accounts, we use another suffix for the
email address.
Change-Id: Ieea72bb45a374eebaa2c51ec74789b337f256958
Tested with:
go run contrib/build-consistency.go
Gives (before the current fix on master):
SHA1 of lib gson does not match: buck has
751f548c85fa49f330cecbb1875893f971b33c4e while bazel has
f1bc476cc167b18e66c297df599b2377131a8947
SHA1 of lib jsr305 does not match: buck has
f7be08ec23c21485b9b5a1cf1654c2ec8c58168d while bazel has
516c03b21d50a644d538de0f0369c620989cd8f0
SHA1 of lib auto_value does not match: buck has
b764e0fb7e11353fbff493b22fd6e83bf091a179 while bazel has
6873fed014fe1de1051aae2af68ba266d2934471
SHA1 of lib junit does not match: buck has
dc7edb9c3060655c7fb93ab9b9349e815bab266f while bazel has
4e031bb61df09069aeb2bffb4019e7a5034a4ee0
SHA1 of lib joda_time does not match: buck has
1c295b462f16702ebe720bbb08f62e1ba80da41b while bazel has
9f2785d7184b97d005a44241ccaf980f43b9ccdb
SHA1 of lib joda_convert does not match: buck has
675642ac208e0b741bc9118dcbcae44c271b992a while bazel has
35ec554f0cd00c956cc69051514d9488b1374dec
Can't parse lib sha1/name on target
maven_jars(name='lucene_core_and_backward_codecs',
srcs=[':backward_codecs_jar',':lucene_core',],visibility=['PUBLIC'],
SHA1 of lib lucene_core does not match: buck has
a74fd869bb5ad7fe6b4cd29df9543a34aea81164 while bazel has
c52b2088e2c30dfd95fd296ab6fb9cf8de9855ab
SHA1 of lib lucene_analyzers_common does not match: buck has
1e0e8243a4410be20c34683034fafa7bb52e55cc while bazel has
c2aa2c4e00eb9cdeb5ac00dc0495e70c441f681e
SHA1 of lib lucene_misc does not match: buck has
504d855a1a38190622fdf990b2298c067e7d60ca while bazel has
95f433b9d7dd470cc0aa5076e0f233907745674b
SHA1 of lib lucene_queryparser does not match: buck has
0fddc49725b562fd48dff0cff004336ad2a090a4 while bazel has
dccd5279bfa656dec21af444a7a66820eb1cd618
SHA1 of lib ow2_asm does not match: buck has
5ef31c4fe953b1fd00b8a88fa1d6820e8785bb45 while bazel has
dcc2193db20e19e1feca8b1240dbbc4e190824fa
SHA1 of lib ow2_asm_analysis does not match: buck has
6d1bf8989fc7901f868bee3863c44f21aa63d110 while bazel has
c7126aded0e8e13fed5f913559a0dd7b770a10f3
SHA1 of lib ow2_asm_commons does not match: buck has
25d8a575034dd9cfcb375a39b5334f0ba9c8474e while bazel has
a7111830132c7f87d08fe48cb0ca07630f8cb91c
SHA1 of lib ow2_asm_tree does not match: buck has
87b38c12a0ea645791ead9d3e74ae5268d1d6c34 while bazel has
287749b48ba7162fb67c93a026d690b29f410bed
SHA1 of lib ow2_asm_util does not match: buck has
b60e33a6bd0d71831e0c249816d01e6c1dd90a47 while bazel has
1512e5571325854b05fb1efce1db75fcced54389
Change-Id: I536b3eecf61a2cd1e7ce9d1c19335f1c2238b6c5
This is just a first version of a py script that
populates a Gerrit instance with some data for
local monkey testing. I'll add some more sugar to
it when I have more time.
Change-Id: I49ecf1ce4f288c5f07254a445a7168cbf83ea2f2
People who would like to use the Diffy logo in their third-party
application for Gerrit probably would start looking for the original logo
sources in the Gerrit repository instead of the discussion group. So copy
the SVG images from [1] to the repository.
[1] https://groups.google.com/d/msg/repo-discuss/nLCvwG2POpM/ENLsQX3ldugJ
Change-Id: Ia9877d9c0a67a1a8c233d9bc49acd1ea3184f9a8
If the Bouncy Castle Crypto libraries are unsigned, issues result with
the Eclipse build, since they rely on the copy that exists in the
libraries copied by the download_file.py script. As a workaround, use
a genrule in ConvertKey to unsign the JARs manually.
Change-Id: I44d6ad5b05a18258e8bf5400c42f1cbd159e59b2
Since we're a BUCK shop, convert the SSH key converter accordingly.
This requires we mark Bouncy Castle as unsign, even though we
do not include this in our normal Gerrit builds. Also, we had to
add slf4j-nop, since this app doesn't require logging.
Change-Id: I85031192f9172a90512d5f28cf1621c10ad6ebf4
If SSH keys are created without Bouncy Castle, the keys are stored in
a non-standard format. These can be read back in and converted back to
standard OpenSSH format through the use of this tool. This may be used
by anyone trying to support new key types after installing Bouncy
Castle.
Change-Id: I52c00fcd44a55c855b5e3a6ebac1283f860e08b8
Fetches a list of open changes that have not been updated since a
given age (default 6 months), and then abandons them.
Assumes that the user's credentials are in the .netrc file. Supports
either basic or digest authentication.
Example to abandon changes that have not been updated for 3 years:
./abandon_stale --gerrit-url http://review.example.com/ --age 3years
Supports dry-run mode to only list the stale changes but not actually
abandon them.
Requires pygerrit (https://github.com/sonyxperiadev/pygerrit).
Change-Id: Ie0edb54847f9f2ab8204647e17e3893ed0a057ea
Use the canonical syntax to specify the python executable to use.
Avoids a fatal error if /usr/bin/python is a too old version (< 2.7).
Change-Id: I3e8affb52be993d35c0dcf90774d962a59ef5635
Fix some minor issues that were reported by pyflakes and pylint.
- Rename arguments to prevent redefinition of built-in 'dir'
- Rename method call to prevent redefinition of built-in 'help'
- Remove unused imports
- Prefix unused variable with underscore to prevent warning
Change-Id: Ia9e21c0f1a69af43f6e4566be46c31bdda540d2f
This is a sort of simplified version of git-review[1] for users like
myself who don't mind most git command line tools, and therefore don't
feel the need to switch to a full git-review workflow, but still don't
like the HEAD:refs/for/master%r=user@domain.com syntax for specifying
reviewers during a push.
Reviewer aliases can be specified in a git config file:
[reviewer]
sop = sop@google.com
$ git push-reviewer --dry-run sop
git push origin HEAD:refs/for/master%r=sop@google.com
[1] http://www.mediawiki.org/wiki/Gerrit/git-review
Change-Id: Ib0c8d609ed9eab17b71ddb13da417a9bfd013611
This script is useful if an existing history should be pushed into a
Gerrit project but the push fails because the server has a max object
size limit configured and the existing history contains objects that
are too large. The script helps to identify the large objects so that
they can be removed from the history by using the 'git filter-branch'
command, or so that the limit can be increased.
Change-Id: I99d21d76ac204bf9b53fd589c0ffcbeee2e02422
ui-api-proxy is a reverse http proxy that allows the UI to be served from
a different host than the API. This allows testing new UI features served
from localhost but using live production data.
Change-Id: I1cef74c995ac21f4310c5ced4c042ece59a1a8e8
The script provides tab-completion in the bash shell for the gerrit.sh
script.
It can be invoked on a per-shell basis, or included in the user's bash
profile to be made available on every login.
Change-Id: I7f8afb8885d42c30df909a0520a0c736b8735fb4
* stable-2.7:
Say in gsql documentation that 'Access Database' capability is required
TrivialRebase: Replace category_id with label
TrivialRebase: Avoid re-adding -2 for code-review label
TrivialRebase: Support custom labels
Fix test skipping flag
Release notes for Gerrit 2.6.2
Fix NullPointerException when comparing AccessSections
Conflicts:
ReleaseNotes/index.txt
tools/release.sh
Change-Id: I3babf1752a7c822fc1c3599643308959bb1da7ec
The diffy theme was causing the overlap observed with the top of
ChangeScreen2 sitting on the bottom of the menu. Adjust the position
of Diffy slightly to fix this.
Change-Id: I8129fb30bea9e5066395d764c59ca59d64411576
This script needs a bit more analysis to make sure all pathways
are covered, but this CL fixes an obvious path.
Change-Id: I2a8404b7a6eecd5cedba3daa20f63917a8d18482
The PEP-8 checker tool (pep8.py) [1, 2] is used to check that Python
scripts follow the Style Guide for Python Code [3].
This change adds a configuration file for that tool. The configuration
overrides the defaults for the following settings:
To make it easier to see what's wrong, enable:
- Quote the lines on which violations are found
- Quote the relevant section of the PEP-8 guideline
The maximum line length according to PEP-8 is 80 characters, but for
some reason the checker defaults to 79, therefore:
- Set maximum line length to 80 characters
According to PEP-8, code should be indented at 4 characters, but the
Google Python Style Guide [4] says 2. Code in Gerrit follows the
Google style, so:
- Disable warnings "Indentation is not a multiple of four"
The configuration is invoked with the --config option when running
the check tool:
$ pep8.py --config ./contrib/.pep8rc myfile.py
[1] https://github.com/jcrocholl/pep8
[2] https://pypi.python.org/pypi/pep8
[3] http://www.python.org/dev/peps/pep-0008/
[4] http://google-styleguide.googlecode.com/svn/trunk/pyguide.html
Change-Id: If02dd9e51cf3a6e0c0238e78bcfad1d7081de742
* Mostly involves changing print to be a function, and adding
"from __future__ import print_function" for copatibility.
Change-Id: I3129233726e0116a348753a2e2bb68806a08668c
Signed-off-by: Chirayu Desai <cdesai@cyanogenmod.org>
Tidy up the docstrings to follow PEP-0257 [1], the Python
Docstring Convention.
The following warnings, reported by the pep257 checker [2], are
removed.
- All modules should have docstrings.
- Multiline docstring should end with 1 blank line.
- First line should be in imperative mood ('Do', not 'Does').
- First line should end with a period.
[1] http://www.python.org/dev/peps/pep-0257/
[2] https://github.com/GreenSteam/pep257
Change-Id: Icdda650d77c3b52c6b4dba62467b45ade8229b48
Shrink the Diffy logo in the Diffy theme so that it doesn't consume
more vertical space than the header menu.
This now matches the theme that is used on
gerrit-review.googlesource.com.
Change-Id: I943253a24bf1e4ab8a74c23d68df8ea3fd18d115
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>