def teardown_test_environment(self, **kwargs): locations = get_app_locations() class JenkinsReport(pep8.BaseReport): def error(instance, line_number, offset, text, check): code = super(JenkinsReport, instance).error( line_number, offset, text, check, ) if not code: return sourceline = instance.line_offset + line_number self.output.write( '%s:%s:%s: %s\n' % (instance.filename, sourceline, offset + 1, text), ) pep8style = pep8.StyleGuide(parse_argv=False, config_file=self.pep8_rcfile, reporter=JenkinsReport, **self.pep8_options) for location in locations: pep8style.input_dir(os.path.relpath(location)) self.output.close()
def teardown_test_environment(self, **kwargs): class JenkinsReport(pep8.BaseReport): def error(instance, line_number, offset, text, check): code = super(JenkinsReport, instance).error( line_number, offset, text, check, ) if not code: return sourceline = instance.line_offset + line_number self.output.write( '%s:%s:%s: %s\n' % (instance.filename, sourceline, offset + 1, text), ) flake8style = get_style_guide( parse_argv=False, config_file=self.pep8_rcfile, reporter=JenkinsReport, **self.pep8_options) # Jenkins pep8 validator requires relative paths project_root = os.path.abspath(os.path.dirname(__name__)) for location in map(lambda x: os.path.relpath(x, project_root), get_app_locations()): flake8style.input_dir(location) self.output.close()
def teardown_test_environment(self, **kwargs): locations = get_app_locations() class JenkinsReport(pep8.BaseReport): def error(instance, line_number, offset, text, check): code = super(JenkinsReport, instance).error( line_number, offset, text, check, ) if not code: return sourceline = instance.line_offset + line_number self.output.write( '%s:%s:%s: %s\n' % (instance.filename, sourceline, offset + 1, text), ) pep8style = pep8.StyleGuide( parse_argv=False, config_file=self.pep8_rcfile, reporter=JenkinsReport, **self.pep8_options ) for location in locations: pep8style.input_dir(os.path.relpath(location)) self.output.close()
def teardown_test_environment(self, **kwargs): class JenkinsReport(pep8.BaseReport): def error(instance, line_number, offset, text, check): code = super(JenkinsReport, instance).error( line_number, offset, text, check, ) if not code: return sourceline = instance.line_offset + line_number self.output.write( '%s:%s:%s: %s\n' % (instance.filename, sourceline, offset + 1, text), ) flake8style = get_style_guide(parse_argv=False, config_file=self.pep8_rcfile, reporter=JenkinsReport, **self.pep8_options) # Jenkins pep8 validator requires relative paths project_root = os.path.abspath(os.path.dirname(__name__)) for location in map(lambda x: os.path.relpath(x, project_root), get_app_locations()): flake8style.input_dir(location) self.output.close()
def teardown_test_environment(self, **kwargs): locations = get_app_locations() report_output = check_output( ['sloccount', "--duplicates", "--wide", "--details"] + locations) report_output = report_output.decode('utf-8') if self.with_migrations: self.output.write(report_output.decode('utf-8')) else: for line in report_output.splitlines(): if '/migrations/' in line: continue self.output.write(line) self.output.write('\n')
def teardown_test_environment(self, **kwargs): locations = get_app_locations() report_output = check_output( ['sloccount', "--duplicates", "--wide", "--details"] + locations ) report_output = report_output.decode('utf-8') if self.with_migrations: self.output.write(report_output.decode('utf-8')) else: for line in report_output.splitlines(): if '/migrations/' in line: continue self.output.write(line) self.output.write('\n')