def run(self, apps_locations, **options): output = codecs.open(os.path.join(options['output_dir'], 'csslint.report'), 'w', 'utf-8') files = list( static_files_iterator(apps_locations + list(getattr(settings, 'STATICFILES_DIRS', [])), extension='.css', ignore_patterns=options['csslint_exclude'].split(','))) if files: cmd = ['csslint', '--format=lint-xml'] + files if options['csslint_ignore']: cmd += ['--ignore=%s' % options['csslint_ignore']] process = subprocess.Popen(cmd, stdout=subprocess.PIPE) process_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1]: # normal csslint return codes raise subprocess.CalledProcessError(retcode, cmd, output=output + '\n' + err) output.write(process_output.decode('utf-8')) else: output.write('<?xml version="1.0" encoding=' '"utf-8"?><lint></lint>') output.close()
def run(self, apps_locations, **options): output = codecs.open(os.path.join(options['output_dir'], 'scss-lint.xml'), 'w', 'utf-8') files = list( static_files_iterator(apps_locations + list(getattr(settings, 'STATICFILES_DIRS', [])), extension='.scss', ignore_patterns=options['scss_lint_exclude'].split(','))) if files: cmd = ['scss-lint', '--format=XML'] + files config_file = getattr(settings, 'SCSS_LINT_CONFIG_FILE', None) if config_file: cmd += ['--config=%s' % config_file] process = subprocess.Popen(cmd, stdout=subprocess.PIPE) process_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1, 2]: # normal scss-lint return codes raise subprocess.CalledProcessError(retcode, cmd, output='%s\n%s' % (output, err)) output.write(process_output.decode('utf-8')) else: output.write('<?xml version="1.0" encoding=' '"utf-8"?><lint></lint>') output.close()
def run(self, apps_locations, **options): output = codecs.open( os.path.join(options['output_dir'], 'csslint.report'), 'w', 'utf-8') files = list( static_files_iterator( apps_locations + list(getattr(settings, 'STATICFILES_DIRS', [])), extension='.css', ignore_patterns=options['csslint_exclude'].split(','))) if files: cmd = ['csslint', '--format=lint-xml'] + files if options['csslint_ignore']: cmd += ['--ignore=%s' % options['csslint_ignore']] process = subprocess.Popen(cmd, stdout=subprocess.PIPE) process_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1]: # normal csslint return codes raise subprocess.CalledProcessError(retcode, cmd, output='{}\n\n{}'.format( output, err)) output.write(process_output.decode('utf-8')) else: output.write('<?xml version="1.0" encoding=' '"utf-8"?><lint></lint>') output.close()
def run(self, apps_locations, **options): output = codecs.open(os.path.join(options['output_dir'], 'scss-lint.xml'), 'w', 'utf-8') files = list( static_files_iterator(apps_locations + list(getattr(settings, 'STATICFILES_DIRS', [])), extension='.scss', ignore_patterns=options['scss_lint_exclude'].split(','))) if files: cmd = ['scss-lint', '--format=XML'] + files config_file = getattr(settings, 'SCSS_LINT_CONFIG_FILE', None) if config_file: cmd += ['--config=%s' % config_file] process = subprocess.Popen(cmd, stdout=subprocess.PIPE) process_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1, 2]: # normal scss-lint return codes raise subprocess.CalledProcessError(retcode, cmd, output='%s\n%s' % (output, err)) output.write(process_output.decode('utf-8')) else: output.write('<?xml version="1.0" encoding=' '"utf-8"?><lint></lint>') output.close()
def run(self, apps_locations, **options): output = codecs.open(os.path.join(options["output_dir"], "csslint.report"), "w", "utf-8") files = list( static_files_iterator( apps_locations + list(getattr(settings, "STATICFILES_DIRS", [])), extension=".css", ignore_patterns=options["csslint_exclude"].split(","), ) ) if files: cmd = ["csslint", "--format=lint-xml"] + files if options["csslint_ignore"]: cmd += ["--ignore=%s" % options["csslint_ignore"]] process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True) process_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1]: # normal csslint return codes raise subprocess.CalledProcessError(retcode, cmd, output=output + "\n" + err) output.write(process_output.decode("utf-8")) else: output.write('<?xml version="1.0" encoding=' '"utf-8"?><lint></lint>') output.close()
def run(self, apps_locations, **options): output = codecs.open(os.path.join(options['output_dir'], 'jshint.xml'), 'w', 'utf-8') files = list( static_files_iterator(apps_locations + list(getattr(settings, 'STATICFILES_DIRS', [])), extension='.js', ignore_patterns=options['jshint_exclude'].split(','))) cmd = ['jshint', '--reporter=jslint'] + files process = subprocess.Popen(cmd, stdout=subprocess.PIPE) jshint_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1, 2]: # normal jshint return codes raise subprocess.CalledProcessError(retcode, cmd, output='%s\n%s' % (jshint_output, err)) output.write(jshint_output.decode('utf-8')) output.close()
def run(self, apps_locations, **options): output = codecs.open(os.path.join(options['output_dir'], 'jshint.xml'), 'w', 'utf-8') files = list( static_files_iterator(apps_locations + list(getattr(settings, 'STATICFILES_DIRS', [])), extension='.js', ignore_patterns=options['jshint_exclude'].split(','))) cmd = ['jshint', '--reporter=jslint'] + files process = subprocess.Popen(cmd, stdout=subprocess.PIPE) jshint_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1, 2]: # normal jshint return codes raise subprocess.CalledProcessError(retcode, cmd, output='{}\n\n{}'.format(output, err)) output.write(jshint_output.decode('utf-8')) output.close()
def run(self, apps_locations, **options): output = codecs.open(os.path.join(options["output_dir"], "jshint.xml"), "w", "utf-8") files = list( static_files_iterator( apps_locations + list(getattr(settings, "STATICFILES_DIRS", [])), extension=".js", ignore_patterns=options["jshint_exclude"].split(","), ) ) cmd = ["jshint", "--reporter=jslint"] + files process = subprocess.Popen(cmd, stdout=subprocess.PIPE) jshint_output, err = process.communicate() retcode = process.poll() if retcode not in [0, 1, 2]: # normal jshint return codes raise subprocess.CalledProcessError(retcode, cmd, output="%s\n%s" % (jshint_output, err)) output.write(jshint_output.decode("utf-8")) output.close()