aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/syntax
diff options
context:
space:
mode:
authorGravatar ccalvarin <ccalvarin@google.com>2017-06-27 17:58:35 +0200
committerGravatar Marcel Hlopko <hlopko@google.com>2017-06-28 10:17:40 +0200
commit3bc1547a5cd78bd6639d968b3cfddbe26b1c31d5 (patch)
treead80da2596d9150632ca6a1f1510060fe849fa3a /src/main/java/com/google/devtools/build/lib/syntax
parent9b394a24dc65c794242e98a8a41eb8a60c78367b (diff)
Add the default category and tag to all options.
Move the default from the annotation to every mention. This makes the incompleteness explicit. Will add the defaults to test targets in a separate change. Once all dependencies are cleaned up, the Option annotation will no longer allow options without the documentationCategory or effectTag, to prevent new options being added without categories while we migrate to the new option categorization. PiperOrigin-RevId: 160281252
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/syntax')
-rw-r--r--src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemanticsOptions.java30
1 files changed, 27 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemanticsOptions.java b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemanticsOptions.java
index 07419e4992..8c69a561b6 100644
--- a/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemanticsOptions.java
+++ b/src/main/java/com/google/devtools/build/lib/syntax/SkylarkSemanticsOptions.java
@@ -15,9 +15,11 @@
package com.google.devtools.build.lib.syntax;
import com.google.devtools.common.options.Option;
+import com.google.devtools.common.options.OptionDocumentationCategory;
import com.google.devtools.common.options.OptionsBase;
import com.google.devtools.common.options.OptionsParser.OptionUsageRestrictions;
import com.google.devtools.common.options.UsesOnlyCoreTypes;
+import com.google.devtools.common.options.proto.OptionFilters.OptionEffectTag;
import java.io.Serializable;
/**
@@ -37,9 +39,11 @@ import java.io.Serializable;
public class SkylarkSemanticsOptions extends OptionsBase implements Serializable {
// Used in an integration test to confirm that flags are visible to the interpreter.
@Option(
- name = "internal_skylark_flag_test_canary",
- defaultValue = "false",
- optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED
+ name = "internal_skylark_flag_test_canary",
+ defaultValue = "false",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED
)
public boolean skylarkFlagTestCanary;
@@ -47,6 +51,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_disallow_set_constructor",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help = "If set to true, disables the deprecated `set` constructor for depsets."
)
public boolean incompatibleDisallowSetConstructor;
@@ -55,6 +61,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_disallow_keyword_only_args",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help = "If set to true, disables the keyword-only argument syntax in function definition."
)
public boolean incompatibleDisallowKeywordOnlyArgs;
@@ -63,6 +71,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_list_plus_equals_inplace",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help =
"If set to true, `+=` on lists works like the `extend` method mutating the original "
+ "list. Otherwise it copies the original list without mutating it."
@@ -73,6 +83,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_disallow_dict_plus",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help = "If set to true, the `+` becomes disabled for dicts."
)
public boolean incompatibleDisallowDictPlus;
@@ -81,6 +93,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_bzl_disallow_load_after_statement",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help =
"If set to true, all `load` must be called at the top of .bzl files, before any other "
+ "statement."
@@ -91,6 +105,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_load_argument_is_label",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help =
"If set to true, the first argument of 'load' statements is a label (not a path). "
+ "It must start with '//' or ':'."
@@ -101,6 +117,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_disallow_toplevel_if_statement",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help =
"If set to true, 'if' statements are forbidden at the top-level "
+ "(outside a function definition)"
@@ -111,6 +129,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_comprehension_variables_do_not_leak",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help =
"If set to true, loop variables in a comprehension shadow any existing variable by "
+ "the same name. If the existing variable was declared in the same scope that "
@@ -123,6 +143,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_depset_is_not_iterable",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help =
"If set to true, depset type is not iterable. For loops and functions expecting an "
+ "iterable will reject depset objects. Use the `.to_list` method to explicitly "
@@ -134,6 +156,8 @@ public class SkylarkSemanticsOptions extends OptionsBase implements Serializable
name = "incompatible_dict_literal_has_no_duplicates",
defaultValue = "false",
category = "incompatible changes",
+ documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
+ effectTags = {OptionEffectTag.UNKNOWN},
help = "If set to true, the dictionary literal syntax doesn't allow duplicated keys."
)
public boolean incompatibleDictLiteralHasNoDuplicates;