Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1441)

Unified Diff: tools/gn/args.cc

Issue 1907613002: GN flag to fail for unused build args. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/gn/docs/reference.md » ('j') | tools/gn/setup.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/args.cc
diff --git a/tools/gn/args.cc b/tools/gn/args.cc
index 1034ea1f31f92ba7015dcfacf68dd767d461519d..496ba18a135632bac42dbcf5b2993eed98f514fd 100644
--- a/tools/gn/args.cc
+++ b/tools/gn/args.cc
@@ -194,25 +194,12 @@ bool Args::VerifyAllOverridesUsed(Err* err) const {
if (all_overrides.empty())
return true;
- // Get a list of all possible overrides for help with error finding.
- //
- // It might be nice to do edit distance checks to see if we can find one close
- // to what you typed.
- std::string all_declared_str;
- for (const auto& map_pair : declared_arguments_per_toolchain_) {
- for (const auto& cur_str : map_pair.second) {
- if (!all_declared_str.empty())
- all_declared_str += ", ";
- all_declared_str += cur_str.first.as_string();
- }
- }
-
*err = Err(
all_overrides.begin()->second.origin(), "Build argument has no effect.",
"The variable \"" + all_overrides.begin()->first.as_string() +
"\" was set as a build argument\nbut never appeared in a " +
- "declare_args() block in any buildfile.\n\nPossible arguments: " +
- all_declared_str);
+ "declare_args() block in any buildfile.\n\n"
+ "To view possible args, run \"gn args --list <builddir>\"");
return false;
}
« no previous file with comments | « no previous file | tools/gn/docs/reference.md » ('j') | tools/gn/setup.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698