Skip to content

Commit

Permalink
Recommend 4 spaces for indentation in the style guide.
Browse files Browse the repository at this point in the history
Users shouldn't worry too much about it, we will soon recommend
using Buildifier.

RELNOTES: None.
PiperOrigin-RevId: 196025297
  • Loading branch information
laurentlb authored and Copybara-Service committed May 9, 2018
1 parent 7eb4cb3 commit fc58231
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions site/docs/skylark/bzl-style.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ to make your files easy to process, both by humans and tools.


* When in doubt, follow the [Python style
guide](https://www.python.org/dev/peps/pep-0008/).
guide](https://www.python.org/dev/peps/pep-0008/). In particular, use 4
4 spaces for indentation (we previously recommended 2, but we now
follow the Python convention).

* Document files and functions using [docstrings](skylint.md#docstrings). Use
a docstring at the top of each `.bzl` file, and a docstring for each public
Expand All @@ -69,12 +71,12 @@ to make your files easy to process, both by humans and tools.

```python
def fct(name, srcs):
filtered_srcs = my_filter(source=srcs)
native.cc_library(
name = name,
srcs = filtered_srcs,
testonly = True,
)
filtered_srcs = my_filter(source = srcs)
native.cc_library(
name = name,
srcs = filtered_srcs,
testonly = True,
)
```

* Prefer values `True` and `False` instead of `0` and `1` for boolean values
Expand Down

0 comments on commit fc58231

Please sign in to comment.