pylint/utils/utils.py
def register_plugins(linter, directory):
    """load all module and package in the given directory, looking for a
    'register' function in each one, used to register pylint checkers
    """
    imported = {}
    for filename in listdir(directory):
        base, extension = splitext(filename)
        if base in imported or base == "__pycache__":
            continue
        if (
            extension in PY_EXTS
            and base != "__init__"
            or (not extension and isdir(join(directory, base)))
        ):
            try:
                module = modutils.load_module_from_file(join(directory, filename))
            except ValueError:
                # empty module name (usually emacs auto-save files)
                continue
            except ImportError as exc:
                print(
                    "Problem importing module %s: %s" % (filename, exc), file=sys.stderr
                )
            else:
                if hasattr(module, "register"):
                    module.register(linter)
                    imported[base] = 1
def register_plugins(linter, directory):
    imported = {}
    for filename in listdir(directory):
        base, extension = splitext(filename)
        if base in imported or base == "__pycache__":
            continue
        if (
            extension in PY_EXTS
            and base != "__init__"
            or (not extension and isdir(join(directory, base)))
        ):
            try:
                module = modutils.load_module_from_file(join(directory, filename))
            except ValueError:
                # empty module name (usually emacs auto-save files)
                continue
            except ImportError as exc:
                print(
                    "Problem importing module %s: %s" % (filename, exc), file=sys.stderr
                )
            else:
                if hasattr(module, "register"):
                    module.register(linter)
                    imported[base] = 1
def register_plugins ( linter , directory ) : imported = { } for filename in listdir ( directory ) : base , extension = splitext ( filename ) if base in imported or base == "__pycache__" : continue if ( extension in PY_EXTS and base != "__init__" or ( not extension and isdir ( join ( directory , base ) ) ) ) : try : module = modutils . load_module_from_file ( join ( directory , filename ) ) except ValueError : # empty module name (usually emacs auto-save files) continue except ImportError as exc : print ( "Problem importing module %s: %s" % ( filename , exc ) , file = sys . stderr ) else : if hasattr ( module , "register" ) : module . register ( linter ) imported [ base ] = 1
load all module and package in the given directory, looking for a
    'register' function in each one, used to register pylint checkers
load all module and package in the given directory looking for a register function in each one used to register pylint checkers