pylint/config.py
def find_pylintrc():
    """search the pylint rc file and return its path if it find it, else None
    """
    # is there a pylint rc file in the current directory ?
    if os.path.exists("pylintrc"):
        return os.path.abspath("pylintrc")
    if os.path.exists(".pylintrc"):
        return os.path.abspath(".pylintrc")
    if os.path.isfile("__init__.py"):
        curdir = os.path.abspath(os.getcwd())
        while os.path.isfile(os.path.join(curdir, "__init__.py")):
            curdir = os.path.abspath(os.path.join(curdir, ".."))
            if os.path.isfile(os.path.join(curdir, "pylintrc")):
                return os.path.join(curdir, "pylintrc")
            if os.path.isfile(os.path.join(curdir, ".pylintrc")):
                return os.path.join(curdir, ".pylintrc")
    if "PYLINTRC" in os.environ and os.path.exists(os.environ["PYLINTRC"]):
        pylintrc = os.environ["PYLINTRC"]
    else:
        user_home = os.path.expanduser("~")
        if user_home in ("~", "/root"):
            pylintrc = ".pylintrc"
        else:
            pylintrc = os.path.join(user_home, ".pylintrc")
            if not os.path.isfile(pylintrc):
                pylintrc = os.path.join(user_home, ".config", "pylintrc")
    if not os.path.isfile(pylintrc):
        if os.path.isfile("/etc/pylintrc"):
            pylintrc = "/etc/pylintrc"
        else:
            pylintrc = None
    return pylintrc
def find_pylintrc():
    """search the pylint rc file and return its path if it find it, else None
    """
    # is there a pylint rc file in the current directory ?
    if os.path.exists("pylintrc"):
        return os.path.abspath("pylintrc")
    if os.path.exists(".pylintrc"):
        return os.path.abspath(".pylintrc")
    if os.path.isfile("__init__.py"):
        curdir = os.path.abspath(os.getcwd())
        while os.path.isfile(os.path.join(curdir, "__init__.py")):
            curdir = os.path.abspath(os.path.join(curdir, ".."))
            if os.path.isfile(os.path.join(curdir, "pylintrc")):
                return os.path.join(curdir, "pylintrc")
            if os.path.isfile(os.path.join(curdir, ".pylintrc")):
                return os.path.join(curdir, ".pylintrc")
    if "PYLINTRC" in os.environ and os.path.exists(os.environ["PYLINTRC"]):
        pylintrc = os.environ["PYLINTRC"]
    else:
        user_home = os.path.expanduser("~")
        if user_home in ("~", "/root"):
            pylintrc = ".pylintrc"
        else:
            pylintrc = os.path.join(user_home, ".pylintrc")
            if not os.path.isfile(pylintrc):
                pylintrc = os.path.join(user_home, ".config", "pylintrc")
    if not os.path.isfile(pylintrc):
        if os.path.isfile("/etc/pylintrc"):
            pylintrc = "/etc/pylintrc"
        else:
            pylintrc = None
    return pylintrc
def find_pylintrc ( ) : # is there a pylint rc file in the current directory ? if os . path . exists ( "pylintrc" ) : return os . path . abspath ( "pylintrc" ) if os . path . exists ( ".pylintrc" ) : return os . path . abspath ( ".pylintrc" ) if os . path . isfile ( "__init__.py" ) : curdir = os . path . abspath ( os . getcwd ( ) ) while os . path . isfile ( os . path . join ( curdir , "__init__.py" ) ) : curdir = os . path . abspath ( os . path . join ( curdir , ".." ) ) if os . path . isfile ( os . path . join ( curdir , "pylintrc" ) ) : return os . path . join ( curdir , "pylintrc" ) if os . path . isfile ( os . path . join ( curdir , ".pylintrc" ) ) : return os . path . join ( curdir , ".pylintrc" ) if "PYLINTRC" in os . environ and os . path . exists ( os . environ [ "PYLINTRC" ] ) : pylintrc = os . environ [ "PYLINTRC" ] else : user_home = os . path . expanduser ( "~" ) if user_home in ( "~" , "/root" ) : pylintrc = ".pylintrc" else : pylintrc = os . path . join ( user_home , ".pylintrc" ) if not os . path . isfile ( pylintrc ) : pylintrc = os . path . join ( user_home , ".config" , "pylintrc" ) if not os . path . isfile ( pylintrc ) : if os . path . isfile ( "/etc/pylintrc" ) : pylintrc = "/etc/pylintrc" else : pylintrc = None return pylintrc
search the pylint rc file and return its path if it find it, else None
search the pylint rc file and return its path if it find it else None