Граф коммитов

58 Коммитов

Автор SHA1 Сообщение Дата
Anthony Yeh 0f2ccdf0fc
Prompt to add DCO signoff in git hook.
Signed-off-by: Anthony Yeh <enisoc@google.com>
2018-03-05 12:41:16 -08:00
Anthony Yeh d6d89fb729
Add git hook to check for DCO signoff.
Signed-off-by: Anthony Yeh <enisoc@google.com>
2018-03-01 10:55:31 -08:00
Anthony Yeh 845310905f
Address code climate issues. 2018-02-27 13:06:28 -08:00
Anthony Yeh 147770fd81
Update scripts for new directory structure. 2018-02-27 12:39:30 -08:00
Michael Berlin fd96276a01 misc: Allow to override the location for pylint via gpylint.
It's installed in a different place on my Mac.
2017-09-23 11:07:10 -07:00
Michael Berlin 24c74fcf2c Merge pull request #3119 from michael-berlin/unused_macos_fix
misc: Fix "unused" git hook for MacOS.
2017-08-29 09:06:48 -07:00
Michael Berlin 0d932c1541 misc: Fix "unused" git hook for MacOS.
"dirname" binary there does not support multiple paths as argument. Instead, we have to run it for each entry.
2017-08-29 07:48:47 -07:00
Michael Berlin 42573076a0 misc: gofmt Git hook: Fix suggested "gofmt" fix command line.
These days, "gofmt" prints the filename, line and error why it failed. We have to strip everything except the filename.

Other improvements:
- Deduplicate file names in case one file has multiple errors.
- Print one file name per line which makes it easier to see which files were affected.
2017-08-29 06:53:59 -07:00
Michael Demmer 1199eed65a ensure GOPATH is set in the pre-commit hook
Atom's new Github integration doesn't pull GOPATH from the environment
(on Mac at least), so make sure it's set in the pre-commit hook.
2017-08-18 09:14:25 -07:00
Michael Demmer 90501da054 change gofmt/goimports git hooks to use bash
On my MacOS laptop, /bin/sh doesn't support echo -n, so update these
hooks to use /bin/bash.
2017-08-17 06:46:27 -07:00
Sugu Sougoumarane 7af23e1dde license: BSD->Apache v2.0
Please refer to #2694 and #2670 for motivation and reasoning for
this change.

I've tried to follow best practice in inserting the copyright
headers. In other open source projects, not all files carry
the notice. For example documentation doesn't. I've followed
similar ground rules.

I did not change the php because there is a separate LICENSE
file there by Pixel Federation. We'll first need to notify
them our intent before changing anything there.

As for the presubmit check, it's going to be non-trivial
because of the number of exceptions, like file types,
directories and generated code. So, it will have to be
a separate project.
2017-05-06 00:38:56 -07:00
Michael Berlin af47b265bb misc: Add two commit hooks for handling the internal bug number in commit messages.
1. pre-commit-msg hook:

If a branch starts with "<bug number>" or "b<bug number>", the bug marker BUG=<bug number> will be automatically added to the commit message.

2. commit-msg hook:

If no bug number is found in the branch, "git commit" will prompt the user for one after they entered the commit message.

This hook applies only to internal developers (i.e. people with a @google.com email address).

Both scripts return early if any commit in the feature branch already has a "BUG=<bug number>" or "b/<bug number>" marker.

Ironically, this commit does not contain a bug marker yet :)
2016-12-06 21:57:29 -08:00
Alain Jobart fe9465686d Beautifying the go 'unused' script a bit.
Renaming error variables to warnings, fixing white spaces.
Also removing extra code that had been merged by mistake
in memorytopo.go in commit 657f565144
2016-08-30 13:17:27 -07:00
Alain Jobart 657f565144 Adding 'unused' go code hook.
It is from this repository: https://github.com/dominikh/go-unused

As part of this change:
- adding download of the tool to bootstrap.sh.
- re-enabling a few tests that were disabled.
- removing a bunch of unused code.
2016-08-30 07:00:20 -07:00
Michael Berlin fbfbaaf55d misc: Add precommit hook for tslint. 2016-07-27 23:12:27 -07:00
Alain Jobart 6bff9aed5b Updating comment. 2015-12-16 07:52:43 -08:00
Alain Jobart 43a0fda983 Now forcing gofmt -s format before commit. 2015-12-16 07:52:01 -08:00
Michael Berlin 0787d482b4 misc: Allow Git pre-commit hook to be run from any working directory.
I have an alias to the pre-commit script which I sometimes run manually
e.g. to go over all lint errors.

Before this fix, pre-commit could only be run from $VTTOP.
2015-12-07 18:41:07 -08:00
Sugu Sougoumarane 8084edfbf2 sqlparser: change JOIN syntax to match MySQL
Specified here: http://dev.mysql.com/doc/refman/5.7/en/join.html
2015-11-23 00:04:12 -08:00
Alain Jobart 11b9990b32 Removing unnecessary govet exception, and fixing paths
in the exception file to prove it works.
2015-11-11 09:57:45 -08:00
Anthony Yeh 6f5c906761 tools: Create separate pylint script.
This lets you run pylint manually, with the same flags that would be
used by the pre-commit hook.
2015-11-10 11:41:30 -08:00
Dean Yasuda b3423f99a0 Fix test/resharding.py typo. 2015-11-05 20:31:38 -08:00
Dean Yasuda b6a7a01efe Use pylint test-mode for fiels in test/.
Clean some obvious pylint errors in test dir.
2015-11-05 16:55:30 -08:00
Dean Yasuda ca109103dd Make pylint pre-commit hook less strict.
Ignore some google-specific warnings that don't apply.

When displaying errors, print path name on each error line instead of as
a header.

Clean up a couple of python files modified while testing.
2015-11-04 19:47:34 -08:00
Alain Jobart 33908c55d1 Excluding proto generated files from golint and pylint. 2015-11-03 08:26:45 -08:00
Dean Yasuda 5da2ccb004 Minor misc/git/hooks/pylint comment fixes. 2015-11-02 17:01:06 -08:00
Dean Yasuda 9ebb500e6d Add pylint pre-commit hook.
This uses /usr/bin/gpylint; systems without gpylint will
skip this check.
2015-11-02 15:51:39 -08:00
Michael Berlin 7cfa14ecd0 misc: Fail precommits if GOPATH is not set.
Some precommits (go vet, golint) require a working Go environment
because they not only look at the file under inspection itself, but they
also try to load the imported packages.

Unfortunately, they don't fail if they cannot load the imports. Instead,
you see subsequent errors due to the missing imports.

For example:

Go vet error: "composite literal uses unkeyed fields"

This occurs when we use a struct initializer
without keyed fields where the struct is defined in another Go package.
In that case, the tools cannot find out how many/which fields the struct
has and if it's actually okay to use unkeyed fields because we specify
all fields.
2015-10-23 17:45:54 -07:00
Alain Jobart bcb1647b49 Adding better error handling for grpc tablet client.
Still seems to break vtgatev2_test.py in grpc though.
2015-08-07 11:41:11 -07:00
Michael Berlin 16e920a949 golint precommit: Assume the shell is non-interactive when grabbing tty failed. 2015-08-05 15:41:00 -07:00
Michael Berlin 90a372642c Fix golint pre commit hook for non-interactive shell.
When running the precommit commands from Eclipse, such a shell is used.
2015-08-05 15:37:25 -07:00
Michael Berlin be3bd1a1b9 Revert "Fix golint pre commit hook for non-interactive shell." 2015-08-05 10:18:18 -07:00
Michael Berlin 2835eb0b43 Fix golint pre commit hook for non-interactive shell.
When running the precommit commands from Eclipse, such a shell is used.
2015-08-04 14:17:32 -07:00
Michael Berlin 4ba6565e1a golint git hook: In case of errors, add "s" (step) mode.
If selected, the user will step through each file with warnings. Between
files, the user has to press enter to make sure that we don't flood the
whole screen and it's easy to fix one file after the other.
2015-06-17 21:57:57 -07:00
Michael Berlin 3aff3976ca golint git hook: Print golint command on new line.
This way it's easier to copy and paste it with a triple mouse click.
2015-06-17 21:57:09 -07:00
Anthony Yeh 38cdee23e9 Remove unused createcl script. 2015-05-05 14:37:30 -07:00
Anthony Yeh 86071decf6 Ignore third_party and Godeps in git precommit hooks. 2015-01-28 15:42:47 -08:00
Anthony Yeh 675db2eb64 Print command to install golint if it's not found. 2014-12-19 13:48:58 -08:00
Anthony Yeh ec0815e2bb Add git pre-submit hook for golint.
Golint should never be required, as per the docs:

"""
The suggestions made by golint are exactly that: suggestions.
Golint is not perfect, and has both false positives and false negatives.
Do not treat its output as a gold standard. We will not be adding
pragmas or other knobs to suppress specific warnings, so do not expect or
require code to be completely "lint-free".
"""

This hook only shows the line count of the golint output for each file
modified in a commit. That way you don't get flooded just because you
changed one line in a file with a hundred pre-existing lint issues.

However, if we just print the warnings without stopping, you'll probably
never see them because your editor comes up to let you write a commit
message. So we try to steal back the keyboard and pause to let you know
you might want to look into the lint warnings. If the stealing ends up
being buggy, we'll have to think of something else.
2014-12-19 13:10:48 -08:00
Anthony Yeh 3ebfb30a5c Simplify instructions for contributing and deprecate createcl. 2014-10-17 19:56:20 -07:00
Anthony Yeh 889a1682ff Add "go vet" as a presubmit and use goimports instead of gofmt. 2014-08-06 12:07:50 -07:00
Alain Jobart 166937eb27 Code coverage helpers. 2014-04-30 13:43:22 -07:00
Alain Jobart 22f185e349 Abbreviated commit. 2013-08-20 11:53:22 -07:00
Alain Jobart e9cb8446bb Better commit log. 2013-08-20 11:46:51 -07:00
Alain Jobart d51ac1475c And really running upload.py. 2013-08-20 10:54:04 -07:00
Alain Jobart 574b8b6c75 Now generate appspot description from git log. 2013-08-20 10:53:16 -07:00
Alain Jobart 01694baf6b Allow the user to specify a --rev to upload.py. 2013-08-20 10:30:40 -07:00
Sugu Sougoumarane 4f0d49c53e keep createcl simple for now 2013-07-25 09:55:11 -07:00
Sugu Sougoumarane 7c0452dd98 fix typo 2013-07-24 21:50:14 -07:00
Sugu Sougoumarane dc1dbf2869 script for appspot code review 2013-07-24 21:40:12 -07:00