Skip to content

Commit

Permalink
Rename gazel to kazel
Browse files Browse the repository at this point in the history
  • Loading branch information
ixdy committed Jul 7, 2017
1 parent 7a0f810 commit 4777038
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 25 deletions.
File renamed without changes.
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -16,8 +16,8 @@ install:
- go install ./...

script:
- verify/verify-boilerplate.sh --rootdir="${TRAVIS_BUILD_DIR}" -v
- verify/verify-go-src.sh --rootdir "${TRAVIS_BUILD_DIR}" -v
- verify/verify-boilerplate.sh --rootdir="$GOPATH/src/k8s.io/repo-infra" -v
- verify/verify-go-src.sh --rootdir "$GOPATH/src/k8s.io/repo-infra" -v
- buildifier -mode=check $(find . -name BUILD -o -name '*.bzl' -type f)
- gazel --print-diff --validate
- kazel --print-diff --validate
- bazel build //...
4 changes: 2 additions & 2 deletions gazel/BUILD → kazel/BUILD
Expand Up @@ -9,7 +9,7 @@ load(
)

go_binary(
name = "gazel",
name = "kazel",
library = ":go_default_library",
tags = ["automanaged"],
)
Expand All @@ -19,8 +19,8 @@ go_library(
srcs = [
"config.go",
"diff.go",
"gazel.go",
"generator.go",
"kazel.go",
"sourcerer.go",
],
tags = ["automanaged"],
Expand Down
36 changes: 18 additions & 18 deletions gazel/README.rst → kazel/README.rst
@@ -1,67 +1,67 @@
gazel - a BUILD file generator for go and bazel
kazel - a BUILD file generator for go and bazel
===============================================

Requirements:
#############

* Your project must be somewhat compatible with go tool because
gazel uses go tool to parse your import tree.
kazel uses go tool to parse your import tree.
* You must have a **GOPATH** and **GOROOT** setup and your project must
be in the correct location in your **GOPATH**.
* Your ``./vendor`` directory may not contain ``BUILD`` files.

Usage:
######

1. Get gazel by running ``go get k8s.io/repo-infra/gazel``.
1. Get kazel by running ``go get k8s.io/repo-infra/kazel``.

2. Create a ``.gazelcfg.json`` in the root of the repository. For the
gazel repository, the ``.gazelcfg.json`` would look like:
2. Create a ``.kazelcfg.json`` in the root of the repository. For the
kazel repository, the ``.kazelcfg.json`` would look like:

.. code-block:: json
{
"GoPrefix": "k8s.io/repo-infra",
"SrcDirs": [
"./gazel"
"./kazel"
],
"SkippedPaths": [
".*foobar(baz)?.*$"
]
}
3. Run gazel:
3. Run kazel:

.. code-block:: bash
$ gazel -root=$GOPATH/src/k8s.io/repo-infra
$ kazel -root=$GOPATH/src/k8s.io/repo-infra
Defaults:
#########

* **SrcDirs** in ``.gazelcfg.json`` defaults to ``["./"]``
* **SrcDirs** in ``.kazelcfg.json`` defaults to ``["./"]``
* ``-root`` option defaults to the current working directory

Automanagement:
###############

gazel reconciles rules that have the "**automanaged**" tag. If
you no longer want gazel to manage a rule, you can remove the
**automanaged** tag and gazel will no longer manage that rule.
kazel reconciles rules that have the "**automanaged**" tag. If
you no longer want kazel to manage a rule, you can remove the
**automanaged** tag and kazel will no longer manage that rule.

gazel only manages srcs, deps, and library attributes of a
kazel only manages srcs, deps, and library attributes of a
rule after initial creation so you can add and managed other
attributes like data and copts and gazel will respect your
attributes like data and copts and kazel will respect your
changes.

gazel automatically formats all ``BUILD`` files in your repository
kazel automatically formats all ``BUILD`` files in your repository
except for those matching **SkippedPaths**.

Adding "sources" rules:
#######################

If you set "**AddSourcesRules**": ``true`` in your ``.gazelcfg.json``,
gazel will create "**package-srcs**" and "**all-srcs**" rules in every
If you set "**AddSourcesRules**": ``true`` in your ``.kazelcfg.json``,
kazel will create "**package-srcs**" and "**all-srcs**" rules in every
package.

The "**package-srcs**" rule is a glob matching all files in the
Expand All @@ -85,6 +85,6 @@ automanaged.
Validating BUILD files in CI:
#############################

If you run gazel with ``--validate``, it will not update any ``BUILD`` files, but it
If you run kazel with ``--validate``, it will not update any ``BUILD`` files, but it
will exit nonzero if any ``BUILD`` files are out-of-date. You can add ``--print-diff``
to print out the changes needed.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion gazel/gazel.go → kazel/kazel.go
Expand Up @@ -30,7 +30,7 @@ var (
dryRun = flag.Bool("dry-run", false, "run in dry mode")
printDiff = flag.Bool("print-diff", false, "print diff to stdout")
validate = flag.Bool("validate", false, "run in dry mode and exit nonzero if any BUILD files need to be updated")
cfgPath = flag.String("cfg-path", ".gazelcfg.json", "path to gazel config (relative paths interpreted relative to -repo.")
cfgPath = flag.String("cfg-path", ".kazelcfg.json", "path to kazel config (relative paths interpreted relative to -repo.")
)

func main() {
Expand Down
2 changes: 1 addition & 1 deletion gazel/sourcerer.go → kazel/sourcerer.go
Expand Up @@ -16,7 +16,7 @@ const (
// walkSource walks the source tree recursively from pkgPath, adding
// any BUILD files to v.newRules to be formatted.
//
// If AddSourcesRules is enabled in the Gazel config, then we additionally add
// If AddSourcesRules is enabled in the kazel config, then we additionally add
// package-sources and recursive all-srcs filegroups rules to every BUILD file.
//
// Returns the list of children all-srcs targets that should be added to the
Expand Down

0 comments on commit 4777038

Please sign in to comment.