aboutsummaryrefslogtreecommitdiffhomepage
path: root/site/docs/skylark
diff options
context:
space:
mode:
authorGravatar laurentlb <laurentlb@google.com>2018-05-09 14:02:42 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-05-09 14:04:10 -0700
commitfc582319605f455bfdbac94fd177d68631644325 (patch)
treed9a9ae1d90911e595576c429f35fb5428561920e /site/docs/skylark
parent7eb4cb351dd8744da54ab84cb09da7f839dfa4c1 (diff)
Recommend 4 spaces for indentation in the style guide.
Users shouldn't worry too much about it, we will soon recommend using Buildifier. RELNOTES: None. PiperOrigin-RevId: 196025297
Diffstat (limited to 'site/docs/skylark')
-rw-r--r--site/docs/skylark/bzl-style.md16
1 files changed, 9 insertions, 7 deletions
diff --git a/site/docs/skylark/bzl-style.md b/site/docs/skylark/bzl-style.md
index 82e65149c9..b9a2df6dc6 100644
--- a/site/docs/skylark/bzl-style.md
+++ b/site/docs/skylark/bzl-style.md
@@ -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
@@ -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