Skip to content

Commit

Permalink
Rollforward of 59e51fe: Flip default value of incompatible_remove_rul…
Browse files Browse the repository at this point in the history
…e_name_parameter

RELNOTES[INC]: name parameter is removed from rule call (#16301)

PiperOrigin-RevId: 477483258
Change-Id: I25e1855731f51e4d4a568e51739aa2f134242ca3
  • Loading branch information
comius authored and Copybara-Service committed Sep 28, 2022
1 parent 7c4a20c commit a76cf2f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Expand Up @@ -70,7 +70,7 @@ public final class BuildLanguageOptions extends OptionsBase {

@Option(
name = "incompatible_remove_rule_name_parameter",
defaultValue = "false",
defaultValue = "true",
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
Expand Down Expand Up @@ -724,7 +724,7 @@ public StarlarkSemantics toStarlarkSemantics() {
public static final String INCOMPATIBLE_STOP_EXPORTING_LANGUAGE_MODULES =
"-incompatible_stop_exporting_language_modules";
public static final String INCOMPATIBLE_REMOVE_RULE_NAME_PARAMETER =
"-incompatible_remove_rule_name_parameter";
"+incompatible_remove_rule_name_parameter";
public static final String INCOMPATIBLE_DISALLOW_SYMLINK_FILE_TO_DIR =
"+incompatible_disallow_symlink_file_to_dir";
public static final String EXPERIMENTAL_ALLOW_TAGS_PROPAGATION =
Expand Down
Expand Up @@ -947,6 +947,7 @@ public void testExportAliasedName() throws Exception {

@Test
public void testExportWithSpecifiedName() throws Exception {
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
evalAndExport(
ev, //
"def _impl(ctx): pass",
Expand All @@ -961,6 +962,7 @@ public void testExportWithSpecifiedName() throws Exception {

@Test
public void testExportWithSpecifiedNameFailure() throws Exception {
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
ev.setFailFast(false);

evalAndExport(
Expand All @@ -973,6 +975,7 @@ public void testExportWithSpecifiedNameFailure() throws Exception {

@Test
public void testExportWithNonStringNameFailsCleanly() throws Exception {
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
ev.setFailFast(false);

evalAndExport(
Expand All @@ -985,6 +988,7 @@ public void testExportWithNonStringNameFailsCleanly() throws Exception {

@Test
public void testExportWithMultipleErrors() throws Exception {
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
ev.setFailFast(false);

evalAndExport(
Expand Down
10 changes: 7 additions & 3 deletions src/test/java/com/google/devtools/build/skydoc/SkydocTest.java
Expand Up @@ -22,7 +22,7 @@
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterables;
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase; // a bad dependency!
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.packages.semantics.BuildLanguageOptions;
import com.google.devtools.build.lib.vfs.FileSystemUtils;
Expand Down Expand Up @@ -267,7 +267,9 @@ public void testRuleExportedWithSpecifiedName() throws Exception {

Module unused =
skydocMain.eval(
StarlarkSemantics.DEFAULT,
StarlarkSemantics.builder()
.setBool(BuildLanguageOptions.INCOMPATIBLE_REMOVE_RULE_NAME_PARAMETER, false)
.build(),
Label.parseAbsoluteUnchecked("//test:test.bzl"),
ruleInfoMap,
ImmutableMap.builder(),
Expand All @@ -294,7 +296,9 @@ public void testUnassignedRuleNotDocumented() throws Exception {

Module unused =
skydocMain.eval(
StarlarkSemantics.DEFAULT,
StarlarkSemantics.builder()
.setBool(BuildLanguageOptions.INCOMPATIBLE_REMOVE_RULE_NAME_PARAMETER, false)
.build(),
Label.parseAbsoluteUnchecked("//test:test.bzl"),
ruleInfoMap,
ImmutableMap.builder(),
Expand Down

0 comments on commit a76cf2f

Please sign in to comment.