コード例 #1
0
ファイル: lint.py プロジェクト: MaraKovalcik/Flask
 def set_option(self, optname, value, action=None, optdict=None):
     """overridden from configuration.OptionsProviderMixin to handle some
     special options
     """
     if optname in self._options_methods or \
             optname in self._bw_options_methods:
         if value:
             try:
                 meth = self._options_methods[optname]
             except KeyError:
                 meth = self._bw_options_methods[optname]
                 warn(
                     '%s is deprecated, replace it by %s' %
                     (optname, optname.split('-')[0]), DeprecationWarning)
             value = check_csv(None, optname, value)
             if isinstance(value, (list, tuple)):
                 for _id in value:
                     meth(_id, ignore_unknown=True)
             else:
                 meth(value)
     elif optname == 'output-format':
         self._reporter_name = value
         # If the reporters are already available, load
         # the reporter class.
         if self._reporters:
             self._load_reporter()
     try:
         BaseTokenChecker.set_option(self, optname, value, action, optdict)
     except UnsupportedAction:
         print >> sys.stderr, 'option %s can\'t be read from config file' % \
               optname
コード例 #2
0
ファイル: lint.py プロジェクト: CoherentLabs/depot_tools
 def set_option(self, optname, value, action=None, optdict=None):
     """overridden from configuration.OptionsProviderMixin to handle some
     special options
     """
     if optname in self._options_methods or \
             optname in self._bw_options_methods:
         if value:
             try:
                 meth = self._options_methods[optname]
             except KeyError:
                 meth = self._bw_options_methods[optname]
                 warn('%s is deprecated, replace it by %s' % (
                     optname, optname.split('-')[0]), DeprecationWarning)
             value = check_csv(None, optname, value)
             if isinstance(value, (list, tuple)):
                 for _id in value:
                     meth(_id, ignore_unknown=True)
             else:
                 meth(value)
     elif optname == 'output-format':
         self._reporter_name = value
         # If the reporters are already available, load
         # the reporter class.
         if self._reporters:
             self._load_reporter()
     try:
         BaseTokenChecker.set_option(self, optname, value, action, optdict)
     except UnsupportedAction:
         print >> sys.stderr, 'option %s can\'t be read from config file' % \
               optname
コード例 #3
0
ファイル: lint.py プロジェクト: MaraKovalcik/Flask
 def __init__(self,
              options=(),
              reporter=None,
              option_groups=(),
              pylintrc=None):
     # some stuff has to be done before ancestors initialization...
     #
     # messages store / checkers / reporter / astroid manager
     self.msgs_store = MessagesStore()
     self.reporter = None
     self._reporter_name = None
     self._reporters = {}
     self._checkers = {}
     self._ignore_file = False
     # visit variables
     self.file_state = FileState()
     self.current_name = None
     self.current_file = None
     self.stats = None
     # init options
     self.options = options + PyLinter.make_options()
     self.option_groups = option_groups + PyLinter.option_groups
     self._options_methods = {
         'enable': self.enable,
         'disable': self.disable
     }
     self._bw_options_methods = {
         'disable-msg': self.disable,
         'enable-msg': self.enable
     }
     full_version = '%%prog %s, \nastroid %s, common %s\nPython %s' % (
         version, astroid_version, common_version, sys.version)
     OptionsManagerMixIn.__init__(self,
                                  usage=__doc__,
                                  version=full_version,
                                  config_file=pylintrc or config.PYLINTRC)
     MessagesHandlerMixIn.__init__(self)
     ReportsHandlerMixIn.__init__(self)
     BaseTokenChecker.__init__(self)
     # provided reports
     self.reports = (
         ('RP0001', 'Messages by category', report_total_messages_stats),
         ('RP0002', '% errors / warnings by module',
          report_messages_by_module_stats),
         ('RP0003', 'Messages', report_messages_stats),
         ('RP0004', 'Global evaluation', self.report_evaluation),
     )
     self.register_checker(self)
     self._dynamic_plugins = set()
     self.load_provider_defaults()
     if reporter:
         self.set_reporter(reporter)
コード例 #4
0
ファイル: lint.py プロジェクト: CoherentLabs/depot_tools
 def __init__(self, options=(), reporter=None, option_groups=(),
              pylintrc=None):
     # some stuff has to be done before ancestors initialization...
     #
     # messages store / checkers / reporter / astroid manager
     self.msgs_store = MessagesStore()
     self.reporter = None
     self._reporter_name = None
     self._reporters = {}
     self._checkers = {}
     self._ignore_file = False
     # visit variables
     self.file_state = FileState()
     self.current_name = None
     self.current_file = None
     self.stats = None
     # init options
     self.options = options + PyLinter.make_options()
     self.option_groups = option_groups + PyLinter.option_groups
     self._options_methods = {
         'enable': self.enable,
         'disable': self.disable}
     self._bw_options_methods = {'disable-msg': self.disable,
                                 'enable-msg': self.enable}
     full_version = '%%prog %s, \nastroid %s, common %s\nPython %s' % (
         version, astroid_version, common_version, sys.version)
     OptionsManagerMixIn.__init__(self, usage=__doc__,
                                  version=full_version,
                                  config_file=pylintrc or config.PYLINTRC)
     MessagesHandlerMixIn.__init__(self)
     ReportsHandlerMixIn.__init__(self)
     BaseTokenChecker.__init__(self)
     # provided reports
     self.reports = (('RP0001', 'Messages by category',
                      report_total_messages_stats),
                     ('RP0002', '% errors / warnings by module',
                      report_messages_by_module_stats),
                     ('RP0003', 'Messages',
                      report_messages_stats),
                     ('RP0004', 'Global evaluation',
                      self.report_evaluation),
                    )
     self.register_checker(self)
     self._dynamic_plugins = set()
     self.load_provider_defaults()
     if reporter:
         self.set_reporter(reporter)
コード例 #5
0
 def __init__(self, linter=None):
     BaseTokenChecker.__init__(self, linter)
     self._lines = None
     self._visited_lines = None
     self._bracket_stack = [None]
コード例 #6
0
 def __init__(self, linter):
     BaseTokenChecker.__init__(self, linter)
     self.stats = None
コード例 #7
0
ファイル: check_elif.py プロジェクト: Andrewou2010/webview
 def __init__(self, linter=None):
     BaseTokenChecker.__init__(self, linter)
     self._init()
コード例 #8
0
ファイル: raw_metrics.py プロジェクト: The-Compiler/pylint
 def __init__(self, linter):
     BaseTokenChecker.__init__(self, linter)
     self.stats = None
コード例 #9
0
ファイル: format.py プロジェクト: gtt116/vimrc
 def __init__(self, linter=None):
     BaseTokenChecker.__init__(self, linter)
     self._lines = None
     self._visited_lines = None
     self._bracket_stack = [None]
コード例 #10
0
ファイル: check_elif.py プロジェクト: aRkadeFR/dotVim
 def __init__(self, linter=None):
     BaseTokenChecker.__init__(self, linter)
     self._init()