Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit naming convention to style guide for rules #8884

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions site/docs/skylark/deploying.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ Every rule repository should have a certain layout so that users can quickly
understand new rules.

For example, suppose we are writing new rules for the (make-believe)
mockascript language. The repository will be named `rules_mockascript`.
We would have the following structure:
`mockascript` language. We would have the following structure:

```
/
Expand All @@ -63,6 +62,24 @@ We would have the following structure:
test.mocs
```

### WORKSPACE

In the project's `WORKSPACE`, you should define the name that users will use
to reference you rules. If your rules belong to the
[bazelbuild](https://github.com/bazelbuild) organization, you must use
aiuto marked this conversation as resolved.
Show resolved Hide resolved
`rules_<lang>` (e.g. `rules_mockascript`). Otherwise, you should name your
repository `<org>_rules_<lang>` (e.g. `build_stack_rules_proto`). Please contact
[bazel-dev mailing list](https://groups.google.com/forum/#!forum/bazel-dev)
if you feel like your rules should follow the convention for rules in the
[bazelbuild](https://github.com/bazelbuild) organization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that the name is an implementation detail of a repository (ideally, they shouldn't rely on it). So I'd rather not have users send us an email for this.

Maybe just remove this sentence?


In the following sections, we will assume the repository belongs to the
[bazelbuild](https://github.com/bazelbuild) organization.

```
workspace(name = "rules_mockascript")
```

### README

At the top level, there should be a `README` that contains (at least) what
Expand Down Expand Up @@ -212,7 +229,9 @@ docs](https://docs.travis-ci.com/user/getting-started/). Then add a
`.travis.yml` file to your repository with the following content:

```
# On trusty images, the Bazel apt repository can be used.
dist: xenial # Ubuntu 16.04

# On trusty (or later) images, the Bazel apt repository can be used.
addons:
apt:
sources:
Expand All @@ -226,14 +245,11 @@ script:
- bazel test //...
```

Right now Bazel has to be compiled from source, as Travis does not support a
version of GCC that works with the precompiled Bazel binaries. Thus, the
`before_install` steps download the Bazel source, compile it, and "install" the
Bazel binary in `/usr/bin`.
This will download and install the latest release of Bazel as precompiled binary.

If your repository is under the [bazelbuild organization](https://github.com/bazelbuild),
contact the [bazel-dev](https://groups.google.com/forum/#!forum/bazel-dev) list
to have it added to [ci.bazel.build](http://ci.bazel.build).
you can [ask to add](https://github.com/bazelbuild/continuous-integration/issues/new?template=adding-your-project-to-bazel-ci.md&title=Request+to+add+new+project+%5BPROJECT_NAME%5D&labels=new-project)
it to [ci.bazel.build](http://ci.bazel.build).

## Documentation

Expand Down