diff options
author | brandjon <brandjon@google.com> | 2018-03-12 09:18:42 -0700 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-03-12 09:20:06 -0700 |
commit | 7ec05f92259f8f07e5322016705ec1dc9632f836 (patch) | |
tree | f0eb1cacb69cbc9420125524d8579a514ed692e4 /site/docs/skylark | |
parent | 72d28f3efc2842510a34cacd930c0204143f7412 (diff) |
Recommend against writing "boolattr = 1" in style guide
RELNOTES: None
PiperOrigin-RevId: 188730878
Diffstat (limited to 'site/docs/skylark')
-rw-r--r-- | site/docs/skylark/build-style.md | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/site/docs/skylark/build-style.md b/site/docs/skylark/build-style.md index b7880dd5c4..6440fd3ee7 100644 --- a/site/docs/skylark/build-style.md +++ b/site/docs/skylark/build-style.md @@ -42,7 +42,7 @@ py_test( "//foo", "//third_party/java/jdk:jdk-k8", ], - flaky = 1, + flaky = True, deps = [ ":check_bar_lib", ":foo_data_check", @@ -167,6 +167,12 @@ is more error-prone and less obvious than an empty list. in macros). *Rationale*: External tools use the name attribute to refer a rule. They need to find rules without having to interpret code. + * When setting boolean-type attributes, use boolean values, not integer values. + For legacy reasons, rules will still convert integers to booleans as needed, + but this is discouraged. *Rationale*: `flaky = 1` could be misread as saying + "deflake this target by rerunning it once". `flaky = True` unambiguously says + "this test is flaky". + ## Differences with Python style guide Although compatibility with |