style_guide.md: Recommend using _prefix_variables within .gni files Change-Id: Ia59f846e51015a7075c4c8731f41818c4cb843c3 Reviewed-on: https://gn-review.googlesource.com/2740 Reviewed-by: Brett Wilson <brettw@chromium.org> Commit-Queue: Brett Wilson <brettw@chromium.org>
diff --git a/docs/style_guide.md b/docs/style_guide.md index 466f872..295d08a 100644 --- a/docs/style_guide.md +++ b/docs/style_guide.md
@@ -284,3 +284,13 @@ `foo_use_bar` - prefixes can be used to indicate a limited scope for an argument (e.g. `rtc_use_h264`, `v8_use_snapshot`) + +#### Variables + +Prefix top-level local variables within `.gni` files with an underscore. This +prefix causes variables to be unavailable to importing scripts. + +``` +_this_var_will_not_be_exported = 1 +but_this_one_will = 2 +``` \ No newline at end of file