Skip to content

Commit b05c3a0

Browse files
comiusaiuto
authored andcommitted
Flip default value of incompatible_remove_rule_name_parameter
RELNOTES[INC]: name parameter is removed from rule call (bazelbuild#16301) PiperOrigin-RevId: 477141270 Change-Id: I140d19f633ede8ba1db0be862316c6a205c96f60
1 parent f36a8f8 commit b05c3a0

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

src/main/java/com/google/devtools/build/lib/packages/semantics/BuildLanguageOptions.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public final class BuildLanguageOptions extends OptionsBase {
7070

7171
@Option(
7272
name = "incompatible_remove_rule_name_parameter",
73-
defaultValue = "false",
73+
defaultValue = "true",
7474
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
7575
effectTags = {OptionEffectTag.LOADING_AND_ANALYSIS},
7676
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
@@ -724,7 +724,7 @@ public StarlarkSemantics toStarlarkSemantics() {
724724
public static final String INCOMPATIBLE_STOP_EXPORTING_LANGUAGE_MODULES =
725725
"-incompatible_stop_exporting_language_modules";
726726
public static final String INCOMPATIBLE_REMOVE_RULE_NAME_PARAMETER =
727-
"-incompatible_remove_rule_name_parameter";
727+
"+incompatible_remove_rule_name_parameter";
728728
public static final String INCOMPATIBLE_DISALLOW_SYMLINK_FILE_TO_DIR =
729729
"+incompatible_disallow_symlink_file_to_dir";
730730
public static final String EXPERIMENTAL_ALLOW_TAGS_PROPAGATION =

src/test/java/com/google/devtools/build/lib/starlark/StarlarkRuleClassFunctionsTest.java

+4
Original file line numberDiff line numberDiff line change
@@ -947,6 +947,7 @@ public void testExportAliasedName() throws Exception {
947947

948948
@Test
949949
public void testExportWithSpecifiedName() throws Exception {
950+
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
950951
evalAndExport(
951952
ev, //
952953
"def _impl(ctx): pass",
@@ -961,6 +962,7 @@ public void testExportWithSpecifiedName() throws Exception {
961962

962963
@Test
963964
public void testExportWithSpecifiedNameFailure() throws Exception {
965+
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
964966
ev.setFailFast(false);
965967

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

974976
@Test
975977
public void testExportWithNonStringNameFailsCleanly() throws Exception {
978+
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
976979
ev.setFailFast(false);
977980

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

986989
@Test
987990
public void testExportWithMultipleErrors() throws Exception {
991+
setBuildLanguageOptions("--noincompatible_remove_rule_name_parameter");
988992
ev.setFailFast(false);
989993

990994
evalAndExport(

src/test/java/com/google/devtools/build/skydoc/SkydocTest.java

+7-3
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import com.google.common.collect.ImmutableMap;
2323
import com.google.common.collect.ImmutableSet;
2424
import com.google.common.collect.Iterables;
25-
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase; // a bad dependency!
25+
import com.google.devtools.build.lib.analysis.util.BuildViewTestCase;
2626
import com.google.devtools.build.lib.cmdline.Label;
2727
import com.google.devtools.build.lib.packages.semantics.BuildLanguageOptions;
2828
import com.google.devtools.build.lib.vfs.FileSystemUtils;
@@ -267,7 +267,9 @@ public void testRuleExportedWithSpecifiedName() throws Exception {
267267

268268
Module unused =
269269
skydocMain.eval(
270-
StarlarkSemantics.DEFAULT,
270+
StarlarkSemantics.builder()
271+
.setBool(BuildLanguageOptions.INCOMPATIBLE_REMOVE_RULE_NAME_PARAMETER, false)
272+
.build(),
271273
Label.parseAbsoluteUnchecked("//test:test.bzl"),
272274
ruleInfoMap,
273275
ImmutableMap.builder(),
@@ -294,7 +296,9 @@ public void testUnassignedRuleNotDocumented() throws Exception {
294296

295297
Module unused =
296298
skydocMain.eval(
297-
StarlarkSemantics.DEFAULT,
299+
StarlarkSemantics.builder()
300+
.setBool(BuildLanguageOptions.INCOMPATIBLE_REMOVE_RULE_NAME_PARAMETER, false)
301+
.build(),
298302
Label.parseAbsoluteUnchecked("//test:test.bzl"),
299303
ruleInfoMap,
300304
ImmutableMap.builder(),

0 commit comments

Comments
 (0)