This repository was archived by the owner on Sep 15, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +24
-0
lines changed
Expand file tree Collapse file tree 4 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -395,5 +395,13 @@ def test_file_doc_title_multiline(self):
395395 '\n \n Documentation continued here.' ,
396396 extractor .description )
397397
398+ def test_loads_ignored (self ):
399+ src = textwrap .dedent ("""\
400+ load("//foo/bar:baz.bzl", "foo_library")
401+ load("//foo/bar:baz.bzl", "foo_test", orig_foo_binary = "foo_binary")
402+ """ )
403+ expected = ''
404+ self .check_protos (src , expected )
405+
398406if __name__ == '__main__' :
399407 unittest .main ()
Original file line number Diff line number Diff line change 3737 "struct" : skylark_globals .struct ,
3838 "repository_rule" : skylark_globals .repository_rule ,
3939 "rule" : skylark_globals .rule ,
40+ "load" : skylark_globals .load ,
4041}
4142"""Stubs for Skylark globals to be used to evaluate the .bzl file."""
4243
Original file line number Diff line number Diff line change @@ -504,5 +504,13 @@ def _impl(ctx):
504504
505505 self .check_protos (src , expected )
506506
507+ def test_loads_ignored (self ):
508+ src = textwrap .dedent ("""\
509+ load("//foo/bar:baz.bzl", "foo_library")
510+ load("//foo/bar:baz.bzl", "foo_test", orig_foo_binary = "foo_binary")
511+ """ )
512+ expected = ''
513+ self .check_protos (src , expected )
514+
507515if __name__ == '__main__' :
508516 unittest .main ()
Original file line number Diff line number Diff line change @@ -36,6 +36,13 @@ def select(x):
3636def struct (** kwargs ):
3737 return None
3838
39+ # TODO(dzc): As a future improvement, consider whether we want to evaluate loads
40+ # in .bzl files and provide links to the rules or macros in the .bzl files
41+ # being loaded. To do so, we would also have to require that all .bzl
42+ # dependencies are being included for the skylark_doc target.
43+ def load (label , * args , ** kwargs ):
44+ return None
45+
3946class Label (object ):
4047 def __init__ (self , label_string ):
4148 self .label_string = label_string
You can’t perform that action at this time.
0 commit comments