Tree-wide discovery of modules, for invariants that need to look beyond the files a commit changed: "some router routes this controller", "some supervisor starts this server", "a test module exists for this module".
Every Elixir file matching the pattern is parsed once per tree object (see
Presubmit.Source.Facts), so repeated discovery on the same revision is
cheap.
Summary
Functions
The module named name in tree, if any file matching pattern defines it.
Every module defined in files of tree matching pattern.
Functions
@spec find(Presubmit.Tree.t(), module(), Presubmit.Pattern.t()) :: Presubmit.Source.Facts.Module.t() | nil
The module named name in tree, if any file matching pattern defines it.
@spec modules(Presubmit.Tree.t(), Presubmit.Pattern.t()) :: [ Presubmit.Source.Facts.Module.t() ]
Every module defined in files of tree matching pattern.