checkTemplateTags function

List<SmfIssue> checkTemplateTags({
  1. required ModuleRegistry registry,
  2. required Resolution resolution,
  3. required Collection collection,
})

Checks the tags of the sockets in the bricks among collection's contributions that apply:

  • every tag is {{{smf_…}}} with a valid name, outside mustache sections, and names a socket that its brick's owner may hold: the template or a provider of the socket's role, a module whose roles include the role of a family member, the module that owns a socket of a module, or anyone for a socket of the pipeline;
  • every template that mason renders is valid mustache; no variable, a tag or not, comes right after a {, no template changes the mustache delimiters or includes a partial, and the path of every file uses no mustache but variables;
  • a presence flag, has_<role>, is of a role that the brick's owner provides, requires or uses, or of a role open to all modules: the pipeline sets no other;
  • only the tag of a socket for one value, such as a minimum version, may appear several times; a socket whose contributions carry imports has its tag in a Dart file, and a socket of the pipeline at the start of a line of pubspec.yaml; both tags of a wrapper are in the same file, the opening one first.

Stage 5 runs it; the contract harness adds missingTemplateTags.

Implementation

List<SmfIssue> checkTemplateTags({
  required ModuleRegistry registry,
  required Resolution resolution,
  required Collection collection,
}) =>
    scanBricks(
      registry: registry,
      resolution: resolution,
      collection: collection,
    ).issues;