Commit Graph

35 Commits (26675562574985dcdae8f8c129608c483f8122d1)

Author SHA1 Message Date
Justin Santa Barbara ed1baf1db1 Fix spelling in package naming linter error message 2016-12-20 15:48:14 -05:00
Chao Xu 15d0984b93 remove hack/verify-munge-docs.sh from pre-commit hooks 2016-12-09 15:17:18 -08:00
Pengfei Ni 27e62180e0 Add pre-commit hooks for verifying pkg names 2016-11-30 15:23:36 +08:00
mbohlool f8863791f7 Add verify script federation OpenAPI spec generation 2016-11-07 02:41:50 -08:00
mbohlool 35b5174bf1 Generate and verify openapi specs in source tree at api/openapi-spec 2016-09-29 17:03:31 -07:00
Tim Hockin faeef5c4ae Use make as the main build tool
This allows us to start building real dependencies into Makefile.

Leave old hack/* scripts in place but advise to use 'make'.  There are a few
rules that call things like 'go run' or 'build/*' that I left as-is for now.
2016-07-12 21:52:00 -07:00
xiangpengzhao 57df873216 Fix typos in pre-commit 2016-06-18 13:11:17 -04:00
Daniel Smith adcd48ccea update documentation & hooks 2016-06-08 17:22:12 -07:00
Tim Hockin 18e7a3eb24 Get rid of hack/after-build scripts
The build is now fast enough to not need them.
2016-05-08 20:32:06 -07:00
Tim Hockin cbf886c7f4 Convert everything to use vendor/ 2016-05-08 20:30:37 -07:00
Klaus Ma 6492cb25ff Corrected format in hooks/pre-commit. 2016-04-20 11:36:14 +08:00
Wojciech Tyczynski 89e860e622 Remove old conversion generator 2016-04-15 12:07:57 +02:00
Erick Fejta 4fc95c129c Remove deep-copy pre-commit hook that no longer exists 2016-03-19 03:35:58 -07:00
laushinka 7ef585be22 Spelling fixes inspired by github.com/client9/misspell 2016-02-18 06:58:05 +07:00
Chao Xu 3ec4cd423e linkchecker tool now visits the URL to determine if it's valid 2016-01-26 17:01:37 -08:00
Karl Isenberg 6125f539b6 Add hack/update-godep-licenses.sh to generate Godeps/LICENSES.md
- Add Godeps/LICENSES.md
- Add verify-godep-licenses to verify that Godeps/LICENSES.md is up to date
- Trigger verify-godep-licenses in the pre-commit hook only if the Godeps dir has changed
- Exclude verify-godep-licenses in verify-all
- Add verify-godep-licenses to make verify (used by travis)
- Add verify-godep-licenses to shippable
- Update dev docs to mention update-godep-licenses
2016-01-14 09:05:25 -08:00
Anastasis Andronidis e27a76ae81 hack and hooks scripts for generating swagger docs 2015-08-22 02:27:41 +02:00
Saad Ali ee89f55bb9 Merge pull request #12188 from eparis/godeps-clean-test
verify-godeps.sh script to make sure all of Godeps is easily reproducible
2015-08-19 16:57:22 -07:00
Eric Paris 3a2dd10545 Speed up pre-commit by always passing at least one file to programs
Some programs like the boilerplate or the flag checker will check the
whole repo if they aren't given a specific set of files to test. If you
use `git commit --amend` to change commit messages you will be calling
these functions with no args, and thus it take a lot longer to commit no
changes than it does to actually commit changes!
2015-08-16 22:15:24 -05:00
Eric Paris 823392e4e3 New test and commit hook to make sure changes to Godeps are reproducable
It is a pretty slow test (it downloads fresh) all of kube's Godeps, so only
run it when needed in pre-commit hook.

This also means that random changes to other non-kube repositories could
cause travis/shippable to just randomly stop working for all PRs which touch
Godeps after that moment (even though no changes have been made to Godeps by
us).  Examples would be things like other repos completely disappearing. Or
even the directory we include disappearing in master in the remote
project (even though the directory may exist at the commit we care
about) This is a bugwin godep, but it is a problem we have seen happen
with kube Godeps.
2015-08-14 14:21:43 -04:00
Eric Paris 8a91d86783 Speed up pre-commit boilerplate by only checking changed files
Although the boilerplate checker was very fast it can be faster. With
this change we can hand the boilerplate a list of files which need to be
checked or give it no files. If given no files it will run all files in
the repo. Before you had to explicitly tell the boiler checker the
'extention' of the the files.  In this case we let the checker figure it
out and load the headers as needed.

Doing the whole repo takes about 0.4 seconds. Doing a single go file
takes < .04 seconds.
2015-08-14 10:19:33 -04:00
Eric Paris f54098fe00 Verify all flag usage does not use _
This works by defining two 'static' lists in hack. The first is the list
of all flags in the project which use a `-` or an `_` in their name. All
files being processed by verify-flags-underscore.py (or all files in the
repo if no filename arguments are given) will be searched for flag
declaration using a simple regex. Its not super smart. If a flag is
found which is not in the static list it will complain/reject the commit
until a human adds it to the list. If we do not keep a static list of
flags it takes >.2 seconds to find them 'all' at runtime. Since this is
run in pre-commit saving every part of a second helps.

After it finds all of the flags it runs all of the arguments (or all
files in repo if no arguments) looking for usage of those flags which
includes an `_`. There are lots of places where these are false
positives. For example we have a flag named oom-adj-score but the kernel
calls it oom_adj_score. To handle this we keep a second 'whitelist' of
lines which are allowed to use these flag names with an `_`.

Running the entire git repo looking for flags in every golang file and
looking in every single file for bad usage takes about 8.75 seconds.

Running it in the precommit hook where we only check things that changed
takes about .06 seconds.
2015-08-12 16:17:02 -04:00
Eric Paris 3b7c39656c Split hack/{verify,update}-* files so we don't always go build
Right now some of the hack/* tools use `go run` and build almost every
time. There are some which expect you to have already run `go install`.
And in all cases the pre-commit hook, which runs a full build wouldn't
want to do either, since it just built!

This creates a new hack/after-build/ directory and has the scripts which
REQUIRE that the binary already be built. It doesn't test and complain.
It just fails miserably. Users should not be in this directory. Users
should just use hack/verify-* which will just do the build and then call
the "after-build" version. The pre-commit hook or anything which KNOWS
the binaries have been built can use the fast version.
2015-08-11 14:20:46 -04:00
Eric Paris 985fa94ebd Move description.sh from hack/ to hooks/
Just to get everything in one place...
2015-08-11 14:20:38 -04:00
Eric Paris 340a99c373 Use hack/verify-boilerplate.sh in pre-commit hook
Using the hack/ version is probably a little slower, but it still only
takes about .2 seconds. So probably worth the reduction in code.
2015-08-10 17:41:36 -04:00
Chao Xu 70a29c1a3a address comments, wait for travis pass 2015-07-27 21:08:02 -07:00
Chao Xu 464385281b add a tool in cmd/ to check links in go file. Currently it's only used to check the links in api descriptions (pkg/api/.../types.go). 2015-07-24 20:21:16 -07:00
Tim Hockin efa76b72ae Run the build once during presubmit 2015-07-02 14:43:43 -07:00
nikhiljindal a89d2da249 Adding a script to verify that swagger spec is updated 2015-06-08 04:04:57 -07:00
Wojciech Tyczynski 33318f0162 Use generated DeepCopy methods. 2015-05-28 09:03:27 +02:00
Jeff Lowdermilk 3cf4d9b2e6 Delete fails on notfound errors.
If deleting multiple resources, command will continue on error and
report not found resources at the end.
2015-05-27 16:02:54 -07:00
Wojciech Tyczynski 2df11cea32 Automatically generate conversions 2015-05-20 17:11:18 +02:00
Tim Hockin 4e9d3f7700 Use color in pre-commit 2015-05-13 12:59:04 -07:00
Tim Hockin d0b2a418db Make git hooks print more nicely 2015-05-13 12:50:25 -07:00
Tim Hockin f11ba4a1b5 Switch git hooks to use pre-commit 2015-05-13 12:50:25 -07:00