code: def check(self, src_tgt, actual_deps):
      
      if self._check_missing_direct_deps or self._check_unnecessary_deps:
        missing_file_deps, missing_direct_tgt_deps = \
          self._compute_missing_deps(src_tgt, actual_deps)
  
        buildroot = get_buildroot()
  
        def shorten(path):  # Make the output easier to read.
          if path.startswith(buildroot):
            return os.path.relpath(path, buildroot)
          return path
  
        def filter_whitelisted(missing_deps):
          # Removing any targets that exist in the whitelist from the list of dependency issues.
          return [(tgt_pair, evidence) for (tgt_pair, evidence) in missing_deps
                              if tgt_pair[0].address not in self._target_whitelist]
  
        missing_direct_tgt_deps = filter_whitelisted(missing_direct_tgt_deps)
  
        if self._check_missing_direct_deps and missing_direct_tgt_deps:
          log_fn = (self.context.log.error if self._check_missing_direct_deps == 'fatal'
                    else self.context.log.warn)
          for (tgt_pair, evidence) in missing_direct_tgt_deps:
            evidence_str = '\n'.join(['  {} uses {}'.format(shorten(e[0]), shorten(e[1]))
                                      for e in evidence])
            log_fn('Missing direct BUILD dependency {} -> {} because:\n{}'
                   .format(tgt_pair[0].address.spec, tgt_pair[1].address.spec, evidence_str))
          if self._check_missing_direct_deps == 'fatal':
            raise TaskError('Missing direct deps.')
  
        if self._check_unnecessary_deps:
          log_fn = (self.context.log.error if self._check_unnecessary_deps == 'fatal'
                    else self.context.log.warn)
          had_unused = self._do_check_unnecessary_deps(src_tgt, actual_deps, log_fn)
          if had_unused and self._check_unnecessary_deps == 'fatal':
            raise TaskError('Unnecessary deps.')
docs: Check for missing deps.
  
      See docstring for _compute_missing_deps for details.