Skip to content

Commit

Permalink
Flip default value of incompatible_remove_rule_name_parameter
Browse files Browse the repository at this point in the history
RELNOTES[INC]: name parameter is removed from rule call (bazelbuild#16301)

PiperOrigin-RevId: 477141270
Change-Id: I140d19f633ede8ba1db0be862316c6a205c96f60
  • Loading branch information
comius authored and aiuto committed Oct 12, 2022
1 parent f36a8f8 commit b05c3a0
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 b05c3a0

Please sign in to comment.