def _check_from_import(self, node: ast.ImportFrom) -> None: if node.level != 0: self._error_callback(LocalFolderImportViolation(node)) if node.module == '__future__': for alias in node.names: if alias.name not in FUTURE_IMPORTS_WHITELIST: self._error_callback( FutureImportViolation(node, text=alias.name), )
def check_local_import(self, node: ast.ImportFrom) -> None: if node.level != 0: self._error_callback(LocalFolderImportViolation(node))
def check_local_import(self, node: ast.ImportFrom) -> None: text = get_error_text(node) if node.level != 0: self.error_callback(LocalFolderImportViolation(node, text=text), )