Beispiel #1
0
    def warn_for_unused_resource_config_paths(self, resource_fqns, disabled):
        unused = self.get_unused_resource_config_paths(resource_fqns, disabled)
        if len(unused) == 0:
            return

        msg = UNUSED_RESOURCE_CONFIGURATION_PATH_MESSAGE.format(
            len(unused), '\n'.join('- {}'.format('.'.join(u)) for u in unused))
        warn_or_error(msg, log_fmt=printer.yellow('{}'))
Beispiel #2
0
 def _fetch_metadata(self, project) -> ProjectPackageMetadata:
     path = self._checkout()
     if self.revision == 'master' and self.warn_unpinned:
         warn_or_error(
             'The git package "{}" is not pinned.\n\tThis can introduce '
             'breaking changes into your project without warning!\n\nSee {}'
             .format(self.git, PIN_PACKAGE_URL),
             log_fmt=printer.yellow('WARNING: {}'))
     loaded = Project.from_project_root(path, {})
     return ProjectPackageMetadata.from_project(loaded)
Beispiel #3
0
    def warn_for_unused_resource_config_paths(self, resource_fqns, disabled):
        unused = self.get_unused_resource_config_paths(resource_fqns, disabled)
        if len(unused) == 0:
            return

        msg = UNUSED_RESOURCE_CONFIGURATION_PATH_MESSAGE.format(
            len(unused),
            '\n'.join('- {}'.format('.'.join(u)) for u in unused)
        )
        warn_or_error(msg, log_fmt=printer.yellow('{}'))
Beispiel #4
0
    def warn_unused(self) -> None:
        unused_tables: Dict[SourceKey, Optional[Set[str]]] = {}
        for patch in self.results.source_patches.values():
            key = (patch.overrides, patch.name)
            if key not in self.patches_used:
                unused_tables[key] = None
            elif patch.tables is not None:
                table_patches = {t.name for t in patch.tables}
                unused = table_patches - self.patches_used[key]
                # don't add unused tables, the
                if unused:
                    # because patches are required to be unique, we can safely
                    # write without looking
                    unused_tables[key] = unused

        if unused_tables:
            msg = self.get_unused_msg(unused_tables)
            warn_or_error(msg, log_fmt=printer.yellow('WARNING: {}'))