pylint/config.py
def register_options_provider(self, provider, own_group=True):
        """register an options provider"""
        assert provider.priority <= 0, "provider's priority can't be >= 0"
        for i in range(len(self.options_providers)):
            if provider.priority > self.options_providers[i].priority:
                self.options_providers.insert(i, provider)
                break
        else:
            self.options_providers.append(provider)
        non_group_spec_options = [
            option for option in provider.options if "group" not in option[1]
        ]
        groups = getattr(provider, "option_groups", ())
        if own_group and non_group_spec_options:
            self.add_option_group(
                provider.name.upper(),
                provider.__doc__,
                non_group_spec_options,
                provider,
            )
        else:
            for opt, optdict in non_group_spec_options:
                self.add_optik_option(provider, self.cmdline_parser, opt, optdict)
        for gname, gdoc in groups:
            gname = gname.upper()
            goptions = [
                option
                for option in provider.options
                if option[1].get("group", "").upper() == gname
            ]
            self.add_option_group(gname, gdoc, goptions, provider)
def register_options_provider(self, provider, own_group=True):
        assert provider.priority <= 0, "provider's priority can't be >= 0"
        for i in range(len(self.options_providers)):
            if provider.priority > self.options_providers[i].priority:
                self.options_providers.insert(i, provider)
                break
        else:
            self.options_providers.append(provider)
        non_group_spec_options = [
            option for option in provider.options if "group" not in option[1]
        ]
        groups = getattr(provider, "option_groups", ())
        if own_group and non_group_spec_options:
            self.add_option_group(
                provider.name.upper(),
                provider.__doc__,
                non_group_spec_options,
                provider,
            )
        else:
            for opt, optdict in non_group_spec_options:
                self.add_optik_option(provider, self.cmdline_parser, opt, optdict)
        for gname, gdoc in groups:
            gname = gname.upper()
            goptions = [
                option
                for option in provider.options
                if option[1].get("group", "").upper() == gname
            ]
            self.add_option_group(gname, gdoc, goptions, provider)
def register_options_provider ( self , provider , own_group = True ) : assert provider . priority <= 0 , "provider's priority can't be >= 0" for i in range ( len ( self . options_providers ) ) : if provider . priority > self . options_providers [ i ] . priority : self . options_providers . insert ( i , provider ) break else : self . options_providers . append ( provider ) non_group_spec_options = [ option for option in provider . options if "group" not in option [ 1 ] ] groups = getattr ( provider , "option_groups" , ( ) ) if own_group and non_group_spec_options : self . add_option_group ( provider . name . upper ( ) , provider . __doc__ , non_group_spec_options , provider , ) else : for opt , optdict in non_group_spec_options : self . add_optik_option ( provider , self . cmdline_parser , opt , optdict ) for gname , gdoc in groups : gname = gname . upper ( ) goptions = [ option for option in provider . options if option [ 1 ] . get ( "group" , "" ) . upper ( ) == gname ] self . add_option_group ( gname , gdoc , goptions , provider )
register an options provider
register an options provider