def check_all(files, style): '''Run flake8 on all paths.''' from flake8 import main # loadDir = g.os_path_finalize_join(g.__file__, '..', '..') # paths = [] # for fn in files: # if dir_: # fn = g.os_path_join(loadDir, dir_, fn) # else: # fn = g.os_path_join(loadDir, fn) # fn = g.os_path_abspath(fn) # if not fn.endswith('.py'): # fn = fn+'.py' # if g.os_path_exists(fn): # # Make *sure* that we check files only once. # if fn in seen: # g.trace('already seen:', fn) # else: # seen.add(fn) # paths.append(fn) # else: # print('does not exist: %s' % (fn)) # Set statistics here, instead of from the command line. # options = style.options # options.statistics = True # options.total_errors = True # options.benchmark = True report = style.check_files(paths=files) main.print_report(report, style)
def check_all(files, style): """Run flake8 on all paths.""" # pylint: disable=import-error from flake8 import main report = style.check_files(paths=files) main.print_report(report, style)
def check_all(files, style): '''Run flake8 on all paths.''' from flake8 import main # loadDir = g.os_path_finalize_join(g.__file__, '..', '..') # paths = [] # for fn in files: # if dir_: # fn = g.os_path_join(loadDir, dir_, fn) # else: # fn = g.os_path_join(loadDir, fn) # fn = g.os_path_abspath(fn) # if not fn.endswith('.py'): # fn = fn+'.py' # if g.os_path_exists(fn): # # Make *sure* that we check files only once. # if fn in seen: # g.trace('already seen:', fn) # else: # seen.add(fn) # paths.append(fn) # else: # print('does not exist: %s' % (fn)) # Set statistics here, instead of from the command line. # options = style.options # options.statistics = True # options.total_errors = True # options.benchmark = True report = style.check_files(paths=files) main.print_report(report, style)
def flake8(): flake8_style = get_style_guide(exclude=','.join( [l.strip() for l in open(GIT_IGNORE).readlines()]), config_file=DEFAULT_CONFIG) report = flake8_style.check_files('./') if report.total_errors > 0: print_report(report, flake8_style) sys.exit(1)
def flake8(): flake8_style = get_style_guide( exclude=','.join([ l.strip() for l in open(GIT_IGNORE).readlines() ]), config_file=DEFAULT_CONFIG ) report = flake8_style.check_files('./') if report.total_errors > 0: print_report(report, flake8_style) sys.exit(1)
def check_all(self, paths): """Run flake8 on all paths.""" config_file = self.get_flake8_config() if config_file: style = engine.get_style_guide(parse_argv=False, config_file=config_file) report = style.check_files(paths=paths) # Set statistics here, instead of from the command line. options = style.options options.statistics = True options.total_errors = True # options.benchmark = True main.print_report(report, style)
def check_all(self, paths): '''Run flake8 on all paths.''' from flake8 import engine, main config_file = self.get_flake8_config() if config_file: style = engine.get_style_guide( parse_argv=False, config_file=config_file, ) report = style.check_files(paths=paths) # Set statistics here, instead of from the command line. options = style.options options.statistics = True options.total_errors = True # options.benchmark = True main.print_report(report, style)
def main(): # flake8 flake8 = get_style_guide(exclude=['.tox', 'build']) report = flake8.check_files([BASE_DIR]) # TODO integration test creating a directory to be git-ified return print_report(report, flake8)
def check_all(self, paths): """Run flake8 on all paths.""" try: # pylint: disable=import-error # We can't assume the user has this. from flake8 import engine, main except Exception: return config_file = self.get_flake8_config() if config_file: style = engine.get_style_guide(parse_argv=False, config_file=config_file) report = style.check_files(paths=paths) # Set statistics here, instead of from the command line. options = style.options options.statistics = True options.total_errors = True # options.benchmark = True main.print_report(report, style)
def flake8_report(self): """ Outputs flake8 report. """ log.info("\n\nFlake8 Report:") base = get_path([BASEDIR, 'tribus']) pys = find_files(path=base, pattern='*.py') flake8_style = get_style_guide() report = flake8_style.check_files(pys) exit_code = print_report(report, flake8_style)
def main(): # flake8 flake8 = get_style_guide(exclude=['.tox', 'build']) report = flake8.check_files([BASE_DIR]) exit_code = print_report(report, flake8) if exit_code > 0: return exit_code # unit tests suite = TestLoader().discover(CODE_DIR, top_level_dir=BASE_DIR) result = TextTestRunner().run(suite) if result.wasSuccessful(): return 0 else: return 1
def main(): # flake8 flake8 = get_style_guide(exclude=['.tox', 'build']) report = flake8.check_files([BASE_DIR]) exit_code = print_report(report, flake8) if exit_code > 0: return exit_code # unit tests suite = TestLoader().discover(CODE_DIR, top_level_dir=BASE_DIR) result = TextTestRunner().run(suite) if result.wasSuccessful(): return 0 else: return 1
def run_flake8(): flake8 = get_style_guide(exclude=['.tox', 'build']) report = flake8.check_files([BASE_DIR]) return print_report(report, flake8)
def run_flake8(): flake8 = get_style_guide(exclude=['.tox', 'build']) report = flake8.check_files([BASE_DIR]) return print_report(report, flake8)
def flake8(): flake8_style = get_style_guide(parse_argv=True, config_file=DEFAULT_CONFIG) report = flake8_style.check_files() if report.total_errors > 0: print_report(report, flake8_style) return report.total_errors
def run_flake8(): print('Running flake8...') flake8 = get_style_guide(exclude=['.tox', 'build'], max_complexity=10) report = flake8.check_files([BASE_DIR]) return print_report(report, flake8)
def check_all(files, style): '''Run flake8 on all paths.''' from flake8 import main report = style.check_files(paths=files) main.print_report(report, style)
def run_flake8(): # flake8 flake8 = get_style_guide(exclude=['.tox', 'build'], max_complexity=10) report = flake8.check_files([BASE_DIR]) return print_report(report, flake8)