Skip to content

Commit

Permalink
Update --incompatible_* error messages
Browse files Browse the repository at this point in the history
RELNOTES: None
PiperOrigin-RevId: 159954456
  • Loading branch information
brandjon authored and hlopko committed Jun 26, 2017
1 parent 0f5b720 commit f5b8d6f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void doExec(Environment env) throws EvalException, InterruptedException {
throw new EvalException(
getLocation(),
"First argument of 'load' must be a label and start with either '//' or ':'. "
+ "Use --incompatibleLoadArgumentIsLabel to temporarily disable this check.");
+ "Use --incompatibleLoadArgumentIsLabel=false to temporarily disable this check.");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1617,8 +1617,9 @@ public Integer invoke(Object x, Location loc, Environment env) throws EvalExcept
throw new EvalException(
loc,
EvalUtils.getDataTypeName(x)
+ " is not iterable. Use --incompatible_depset_is_not_iterable=false to "
+ "temporarily disable this check.");
+ " is not iterable. You may use `len(<depset>.to_list())` instead. Use "
+ "--incompatible_depset_is_not_iterable=false to temporarily disable this "
+ "check.");
}
int l = EvalUtils.size(x);
if (l == -1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ private static void checkLoadAfterStatement(List<Statement> statements) throws E
"load() statements must be called before any other statement. "
+ "First non-load() statement appears at "
+ firstStatement
+ ". Use --incompatible_bzl_disallow_load_after_statement to temporarily disable "
+ "this check.");
+ ". Use --incompatible_bzl_disallow_load_after_statement=false to temporarily "
+ "disable this check.");
}

if (firstStatement == null) {
Expand All @@ -173,7 +173,7 @@ private static void checkToplevelIfStatement(List<Statement> statements) throws
statement.getLocation(),
"if statements are not allowed at the top level. You may move it inside a function "
+ "or use an if expression (x if condition else y). "
+ "Use --incompatible_disallow_toplevel_if_statement to temporarily disable "
+ "Use --incompatible_disallow_toplevel_if_statement=false to temporarily disable "
+ "this check.");
}
}
Expand Down

0 comments on commit f5b8d6f

Please sign in to comment.