Fixed indentation problem: 8 spaces -> 4 spaces
--
MOS_MIGRATED_REVID=117583615
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
index 8fa5cb5..1b69685 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/RuleContext.java
@@ -1709,11 +1709,11 @@
}
if (attribute.getAllowedRuleClassesWarningPredicate()
- != Predicates.<RuleClass>alwaysTrue()) {
+ != Predicates.<RuleClass>alwaysTrue()) {
allowedWithWarning = attribute.getAllowedRuleClassesWarningPredicate().apply(ruleClass);
if (allowedWithWarning) {
reportBadPrerequisite(attribute, prerequisiteTarget.getTargetKind(), prerequisiteLabel,
- "expected " + attribute.getAllowedRuleClassesPredicate(), true);
+ "expected " + attribute.getAllowedRuleClassesPredicate(), true);
return;
}
}
@@ -1722,13 +1722,13 @@
String missingMandatoryProviders = getMissingMandatoryProviders(prerequisite, attribute);
if (missingMandatoryProviders != null) {
attributeError(
- attribute.getName(),
- "'" + prerequisite.getLabel() + "' does not have mandatory provider "
- + missingMandatoryProviders);
+ attribute.getName(),
+ "'" + prerequisite.getLabel() + "' does not have mandatory provider "
+ + missingMandatoryProviders);
}
} else if (Boolean.FALSE.equals(allowed)) {
reportBadPrerequisite(attribute, prerequisiteTarget.getTargetKind(), prerequisiteLabel,
- "expected " + attribute.getAllowedRuleClassesPredicate(), false);
+ "expected " + attribute.getAllowedRuleClassesPredicate(), false);
}
}
diff --git a/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java b/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java
index a6eca3a..8561dfd 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/SkylarkAttr.java
@@ -100,10 +100,10 @@
private static final String PROVIDERS_ARG = "providers";
private static final String PROVIDERS_DOC =
- "mandatory providers list. It should be either a list of providers, or a "
- + "list of lists of providers. Every dependency should provide ALL providers "
- + "from at least ONE of these lists. A single list of providers will be "
- + "automatically converted to a list containing one list of providers.";
+ "mandatory providers list. It should be either a list of providers, or a "
+ + "list of lists of providers. Every dependency should provide ALL providers "
+ + "from at least ONE of these lists. A single list of providers will be "
+ + "automatically converted to a list containing one list of providers.";
private static final String SINGLE_FILE_ARG = "single_file";
@@ -212,18 +212,18 @@
private static List<List<String>> getProvidersList(SkylarkList skylarkList) throws EvalException {
List<List<String>> providersList = new ArrayList<>();
String errorMsg = "Illegal argument: element in '%s' is of unexpected type. "
- + "Should be list of string, but got %s. "
- + "Notice: one single list of string as 'providers' is still supported.";
+ + "Should be list of string, but got %s. "
+ + "Notice: one single list of string as 'providers' is still supported.";
for (Object o : skylarkList) {
if (!(o instanceof SkylarkList)) {
throw new EvalException(null, String.format(errorMsg, PROVIDERS_ARG,
- EvalUtils.getDataTypeName(o, true)));
+ EvalUtils.getDataTypeName(o, true)));
}
for (Object value : (SkylarkList) o) {
if (!(value instanceof String)) {
throw new EvalException(null, String.format(errorMsg, PROVIDERS_ARG,
"list with an element of type "
- + EvalUtils.getDataTypeNameFromClass(value.getClass())));
+ + EvalUtils.getDataTypeNameFromClass(value.getClass())));
}
}
providersList.add(((SkylarkList<?>) o).getContents(String.class, PROVIDERS_ARG));
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
index ab8d490..ae048a0 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
@@ -76,7 +76,7 @@
Runfiles commonRunfiles = collectCommonRunfiles(ruleContext, common, semantics);
Runfiles.Builder defaultRunfilesBuilder = new Runfiles.Builder(ruleContext.getWorkspaceName())
- .merge(commonRunfiles);
+ .merge(commonRunfiles);
semantics.collectDefaultRunfilesForBinary(ruleContext, defaultRunfilesBuilder);
Runfiles defaultRunfiles = defaultRunfilesBuilder.build();
diff --git a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java
index 34c66f1..2b01aec 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/python/PyCommon.java
@@ -274,13 +274,13 @@
}
private NestedSet<Artifact> getTransitivePythonSourcesFromSkylarkProvider(
- TransitiveInfoCollection dep) {
+ TransitiveInfoCollection dep) {
SkylarkClassObject pythonSkylarkProvider = null;
SkylarkProviders skylarkProviders = dep.getProvider(SkylarkProviders.class);
try {
if (skylarkProviders != null) {
pythonSkylarkProvider = skylarkProviders.getValue(PYTHON_SKYLARK_PROVIDER_NAME,
- SkylarkClassObject.class);
+ SkylarkClassObject.class);
}
if (pythonSkylarkProvider != null) {
@@ -292,11 +292,11 @@
errorType = EvalUtils.getDataTypeNameFromClass(sourceFiles.getClass());
}
String errorMsg = "Illegal Argument: attribute '%s' in provider '%s' is "
- + "of unexpected type. Should be a set, but got a '%s'";
+ + "of unexpected type. Should be a set, but got a '%s'";
NestedSet<Artifact> pythonSourceFiles = SkylarkType.cast(
- sourceFiles, SkylarkNestedSet.class, Artifact.class, null,
- errorMsg, TRANSITIVE_PYTHON_SRCS, PYTHON_SKYLARK_PROVIDER_NAME, errorType)
- .getSet(Artifact.class);
+ sourceFiles, SkylarkNestedSet.class, Artifact.class, null,
+ errorMsg, TRANSITIVE_PYTHON_SRCS, PYTHON_SKYLARK_PROVIDER_NAME, errorType)
+ .getSet(Artifact.class);
return pythonSourceFiles;
}
} catch (EvalException e) {
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
index 94c822b..81636b1 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleClassFunctionsTest.java
@@ -179,39 +179,39 @@
public void testAttrWithProviders() throws Exception {
Attribute attr =
evalAttributeDefinition("attr.label_list(allow_files = True, providers = ['a', 'b'])")
- .build("a1");
+ .build("a1");
assertThat(attr.getMandatoryProvidersList()).containsExactly(ImmutableSet.of("a", "b"));
}
@Test
public void testAttrWithProvidersList() throws Exception {
Attribute attr =
- evalAttributeDefinition("attr.label_list(allow_files = True,"
- + " providers = [['a', 'b'], ['c']])")
- .build("a1");
+ evalAttributeDefinition("attr.label_list(allow_files = True,"
+ + " providers = [['a', 'b'], ['c']])")
+ .build("a1");
assertThat(attr.getMandatoryProvidersList()).containsExactly(ImmutableSet.of("a", "b"),
- ImmutableSet.of("c"));
+ ImmutableSet.of("c"));
}
@Test
public void testAttrWithWrongProvidersList() throws Exception {
checkErrorContains("Illegal argument: element in 'providers' is of unexpected type."
+ " Should be list of string, but got list with an element of type int.",
- "attr.label_list(allow_files = True, providers = [['a', 1], ['c']])");
+ "attr.label_list(allow_files = True, providers = [['a', 1], ['c']])");
checkErrorContains("Illegal argument: element in 'providers' is of unexpected type."
+ " Should be list of string, but got string.",
- "attr.label_list(allow_files = True, providers = [['a', 'b'], 'c'])");
+ "attr.label_list(allow_files = True, providers = [['a', 'b'], 'c'])");
}
@Test
public void testLabelListWithAspects() throws Exception {
SkylarkAttr.Descriptor attr =
(SkylarkAttr.Descriptor) evalRuleClassCode(
- "def _impl(target, ctx):",
- " pass",
- "my_aspect = aspect(implementation = _impl)",
- "attr.label_list(aspects = [my_aspect])");
+ "def _impl(target, ctx):",
+ " pass",
+ "my_aspect = aspect(implementation = _impl)",
+ "attr.label_list(aspects = [my_aspect])");
Object aspect = ev.lookup("my_aspect");
assertThat(aspect).isNotNull();
assertThat(attr.getAspects()).containsExactly(aspect);
@@ -273,12 +273,12 @@
private static final RuleClass.ConfiguredTargetFactory<Object, Object>
DUMMY_CONFIGURED_TARGET_FACTORY =
- new RuleClass.ConfiguredTargetFactory<Object, Object>() {
- @Override
- public Object create(Object ruleContext) throws InterruptedException {
- throw new IllegalStateException();
- }
- };
+ new RuleClass.ConfiguredTargetFactory<Object, Object>() {
+ @Override
+ public Object create(Object ruleContext) throws InterruptedException {
+ throw new IllegalStateException();
+ }
+ };
private RuleClass ruleClass(String name) {
return new RuleClass.Builder(name, RuleClassType.NORMAL, false)
@@ -614,7 +614,7 @@
public void testJsonInvalidStructure() throws Exception {
checkErrorContains(
"Invalid text format, expected a struct, a string, a bool, or an int but got a "
- + "ConfigurationTransition for struct field 'a'",
+ + "ConfigurationTransition for struct field 'a'",
"struct(a=DATA_CFG).to_json()");
}
diff --git a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java
index c47fdbe..113ba74 100644
--- a/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java
+++ b/src/test/java/com/google/devtools/build/lib/skylark/SkylarkRuleContextTest.java
@@ -424,7 +424,7 @@
assertNotNull(tic1.getProvider(JavaSourceJarsProvider.class));
// Check an unimplemented provider too
assertNull(tic1.getProvider(SkylarkProviders.class)
- .getValue(PyCommon.PYTHON_SKYLARK_PROVIDER_NAME));
+ .getValue(PyCommon.PYTHON_SKYLARK_PROVIDER_NAME));
}
@Test
diff --git a/src/test/java/com/google/devtools/build/lib/testutil/TestRuleClassProvider.java b/src/test/java/com/google/devtools/build/lib/testutil/TestRuleClassProvider.java
index 8b708a3..60faf47 100644
--- a/src/test/java/com/google/devtools/build/lib/testutil/TestRuleClassProvider.java
+++ b/src/test/java/com/google/devtools/build/lib/testutil/TestRuleClassProvider.java
@@ -92,20 +92,20 @@
@Override
public RuleClass build(Builder builder, RuleDefinitionEnvironment env) {
return builder
- .setUndocumented()
- .add(attr("srcs", LABEL_LIST).allowedFileTypes(FileTypeSet.ANY_FILE))
- .override(builder.copy("deps").mandatoryProvidersList(ImmutableList.of(
- ImmutableList.of("a"), ImmutableList.of("b", "c"))))
- .build();
+ .setUndocumented()
+ .add(attr("srcs", LABEL_LIST).allowedFileTypes(FileTypeSet.ANY_FILE))
+ .override(builder.copy("deps").mandatoryProvidersList(ImmutableList.of(
+ ImmutableList.of("a"), ImmutableList.of("b", "c"))))
+ .build();
}
@Override
public Metadata getMetadata() {
return RuleDefinition.Metadata.builder()
- .name("testing_rule_for_mandatory_providers")
- .ancestors(BaseRuleClasses.RuleBase.class)
- .factoryClass(UnknownRuleConfiguredTarget.class)
- .build();
+ .name("testing_rule_for_mandatory_providers")
+ .ancestors(BaseRuleClasses.RuleBase.class)
+ .factoryClass(UnknownRuleConfiguredTarget.class)
+ .build();
}
}
}