IMPORTANT: The Bazel docs have moved! Please update your bookmark to

You can read about the migration, and let us know what you think.

Extensions > API reference > rule


A callable value representing the type of a native or Starlark rule. Calling the value during evaluation of a package's BUILD file creates an instance of the rule and adds it to the package's target set.