diff options
author | 2017-11-07 21:36:56 +0100 | |
---|---|---|
committer | 2017-11-08 16:32:15 +0100 | |
commit | b064b3c30c48f6b2431c31ee078af8da5620e2c9 (patch) | |
tree | c56f71f6dae585de82822b7a49f04b8f3399f2fd /site/docs/skylark/skylint.md | |
parent | 7b2045e59a0ee438867acd3b11c9c6d98dcd9690 (diff) |
Linter: fix documentation, take 2
The previous fix (https://github.com/bazelbuild/bazel/commit/da30589fb9b7f4abe7280ffef73da909c1706b49) was incomplete.
Anchor names were missing for some sections.
RELNOTES: none
PiperOrigin-RevId: 174896528
Diffstat (limited to 'site/docs/skylark/skylint.md')
-rw-r--r-- | site/docs/skylark/skylint.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/site/docs/skylark/skylint.md b/site/docs/skylark/skylint.md index c4b5eb5b1f..05ad4dec0f 100644 --- a/site/docs/skylark/skylint.md +++ b/site/docs/skylark/skylint.md @@ -68,6 +68,7 @@ occupy multiple lines, with all lines indented by two spaces. #### Using the operator + on dictionaries [deprecated-plus-dict] +<a name="deprecated-plus-dict"></a> The `+` operator (and similarly `+=`) is deprecated for dictionaries. Instead, use the following: @@ -186,6 +187,7 @@ In detail, the rules are the following: ### Statements without effects [no-effect] +<a name="no-effect"></a> If a statement is just an expression that is not a function call, the analyzer warns `expression result not used`. Most likely, you forgot to do something with that value. Examples: `1 + foo()`, `foo[bar]`. @@ -212,6 +214,7 @@ def baz(): ### Return value lint [missing-return-value] +<a name="missing-return-value"></a> If a function returns with a value (`return foo`) in some execution paths and without one (just `return` or reaching the end of a function) in other execution paths, the analyzer will warn about this. The reason for this is that you @@ -250,6 +253,7 @@ to the end of the function in order to silence the warning. ### Uninitialized variables [uninitialized-variable] +<a name="uninitialized-variable"></a> If a variable is not initialized before it's used on every execution path, the analyzer warns about it: @@ -273,6 +277,7 @@ before using it. ### Unused bindings [unused-binding] +<a name="unused-binding"></a> If a binding of an identifier is not used, the analyzer warns about it: ``` @@ -344,6 +349,6 @@ This way, the name is still re-exported but doesn't generate a warning. ### Miscellaneous lints -* **unreachable statements** [unreachable-statement] -* **Load statements** must be **at the top** of the file (after the docstring) +* <a name="unreachable-statement"></a>**unreachable statements** [unreachable-statement] +* <a name="load-at-top"></a>**Load statements** must be **at the top** of the file (after the docstring) [load-at-top] |