当前位置: 首页>>代码示例>>Python>>正文


Python PyLinter.expand_files方法代码示例

本文整理汇总了Python中pylint.lint.PyLinter.expand_files方法的典型用法代码示例。如果您正苦于以下问题:Python PyLinter.expand_files方法的具体用法?Python PyLinter.expand_files怎么用?Python PyLinter.expand_files使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pylint.lint.PyLinter的用法示例。


在下文中一共展示了PyLinter.expand_files方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: expand_files

# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import expand_files [as 别名]
 def expand_files(self, modules):
     expanded = PyLinter.expand_files(self, modules)
     filtered = []
     for module in expanded:
         if self._files.check_module(module['path']):
             filtered.append(module)
     return filtered
开发者ID:kamilchm,项目名称:prospector,代码行数:9,代码来源:linter.py

示例2: process_file

# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import expand_files [as 别名]
def process_file(filename):
    """
    Analyze the file with pylint and write the result
    to a database
    """
    linter = PyLinter()

    checkers.initialize(linter)
    linter.read_config_file()
    linter.quiet = 1

    filemods = linter.expand_files((filename, ))
    if filemods:
        old_stats = config.load_results(filemods[0].get('basename'))
        old_score = old_stats.get('global_note', 0.0)

    linter.check(filename)
    score = eval(linter.config.evaluation, {}, linter.stats)

    # Calculate the credit for both scores
    if score < 0:
        credit = 2.0 * score
    elif score < old_score:
        credit = -1.5 * (old_score - score)
    elif score < MINIMUM_SCORE:
        credit = -1.5 * (MINIMUM_SCORE - score)
    else:
        credit = score - old_score

    return score, old_score, credit
开发者ID:codecollision,项目名称:DropboxToFlickr,代码行数:32,代码来源:huLint.py

示例3: expand_files

# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import expand_files [as 别名]
 def expand_files(self, modules):
     expanded = PyLinter.expand_files(self, modules)
     filtered = []
     for module in expanded:
         if any([m.search(module['path']) for m in self._ignore]):
             continue
         filtered.append(module)
     return filtered
开发者ID:marciusvinicius,项目名称:prospector,代码行数:10,代码来源:linter.py

示例4: expand_files

# 需要导入模块: from pylint.lint import PyLinter [as 别名]
# 或者: from pylint.lint.PyLinter import expand_files [as 别名]
 def expand_files(self, modules):
     expanded = PyLinter.expand_files(self, modules)
     filtered = []
     for module in expanded:
         rel_path = os.path.relpath(module['path'], self._rootpath)
         if any([m.search(rel_path) for m in self._ignore]):
             continue
         filtered.append(module)
     return filtered
开发者ID:TomasTomecek,项目名称:prospector,代码行数:11,代码来源:linter.py


注:本文中的pylint.lint.PyLinter.expand_files方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。