Run except function in :linter_functions: on file_path.

    This function calls through to _run_lint_on_file, but prints a traceback
    for any exceptions encountered. It is intended to be used with parmap.
778701
def _run_lint_on_file_exceptions(file_path,
                                 linter_functions,
                                 tool_options,
                                 fix_what_you_can):
    
    try:
        return _run_lint_on_file(file_path,
                                 linter_functions,
                                 tool_options,
                                 fix_what_you_can)
    except Exception as exception:
        sys.stderr.write("""Encountered exception when processing {}\n""".format(file_path))
        traceback.print_exc()
        raise exception
510024
def lint_file(file_path):
    

    with open(file_path, 'r') as yaml:
        try:
            return lint(yaml)
        except Exception as e:
            lr = LintResult()
            lr.add_error('could not parse YAML: %s' % e, exception=e)
            return lr
724055
function(file, lint, isError, isWarning, errorLocation) {
        var lintId = (isError) ? colors.bgRed(colors.white(lint.id)) : colors.bgYellow(colors.white(lint.id));
        var message = '';
        if (errorLocation) {
            message = file.path + ':' + (errorLocation.line + 1) + ':' + (errorLocation.column + 1) + ' ' + lintId + ' ' + lint.message;
        } else {
            message = file.path + ': ' + lintId + ' ' + lint.message;
        }

        if (isError) {
            log.error(message);
        } else {
            log.warning(message);
        }
    }
1114061
def run_linter(linter, engine, file_path)
      return if @config.excluded_file_for_linter?(file_path, linter)
      @lints += linter.run(engine, @config.linter_options(linter))
    end
413217
def runpath(path, argv, filename=None, threads=True, verbose=False):
    
    _run(threads, verbose, 'runpath', filename, path, argv)
469220
function lint (files) {
  const stream = gulp.src(files)
  .pipe($.plumber())
  .pipe($.eslint())
  .pipe($.eslint.format())
  if (process.env.NODE_ENV === 'production') {
    stream.pipe($.eslint.failOnError())
  }
  stream.on('error', onError)
  return stream
}
800894
def exception(function):
    
    @functools.wraps(function)
    def wrapper(*args, **kwargs):
        try:
            return function(*args, **kwargs)
        except Exception as e:
            # print 
            err = "There was an exception in %s():"%(function.__name__)
            print(("%s \n %s \n%s"%(err,e,sys.exc_info())))
            return -1
 
    return wrapper
883862
public static <X> X runWithFile(InputStream stream, Function<File, X> function) throws IOException {
		File f = File.createTempFile("run-with-file", null);
		try {
			try (FileOutputStream out = new FileOutputStream(f)) {
				IOUtils.copy(stream, out);
			}
			return function.apply(f);
		} finally {
			f.delete();
		}
	}
493496
def run(self):
        '''
        
        '''
        self.parse_args()

        if self.options.file_root:
            # check if the argument is pointing to a file on disk
            file_root = os.path.abspath(self.options.file_root)
            self.config['file_roots'] = {'base': _expand_glob_path([file_root])}

        if self.options.pillar_root:
            # check if the argument is pointing to a file on disk
            pillar_root = os.path.abspath(self.options.pillar_root)
            self.config['pillar_roots'] = {'base': _expand_glob_path([pillar_root])}

        if self.options.states_dir:
            # check if the argument is pointing to a file on disk
            states_dir = os.path.abspath(self.options.states_dir)
            self.config['states_dirs'] = [states_dir]

        if self.options.local:
            self.config['file_client'] = 'local'
        if self.options.master:
            self.config['master'] = self.options.master

        # Setup file logging!
        self.setup_logfile_logger()
        verify_log(self.config)

        caller = salt.cli.caller.Caller.factory(self.config)

        if self.options.doc:
            caller.print_docs()
            self.exit(salt.defaults.exitcodes.EX_OK)

        if self.options.grains_run:
            caller.print_grains()
            self.exit(salt.defaults.exitcodes.EX_OK)

        caller.run()
372638
def lint_file_paths(files, ext)
        file_list = files.map { |f| f[:filename] }.compact
        # Lints accept files differently
        ext == :ruby ? file_list.join(' ') : file_list.join(',')
      end
957831
def run_lint(bin, file)
      command = "#{bin} -f json"
      command << " -c #{config_file}" if config_file
      command << " --ignore-path #{ignore_file}" if ignore_file
      result = `#{command} #{file}`
      JSON.parse(result)
    end
873764
def lint
      return if target_files.empty?

      bin = textlint_path
      result_json = run_textlint(bin, target_files)
      errors = parse(result_json)
      send_comment(errors)
    end
424320
def run(line):
    
    arguments = shlex.split(line)
    path = lookup(arguments[0])  # Lookup the first arguments in PATH
    execute(path, arguments)
308442
function lintFile (linter, fileName) {
  const fileContents = fs.readFileSync(fileName, {encoding: 'utf8'}).toString()
  const report = linter.validate(fileContents)
  const errors = report.error.count
  const warnings = report.warn.count

  if (errors || warnings) {
    this.printFilePath(fileName)

    report.error.data.forEach(logItem.bind(this))
    report.warn.data.forEach(logItem.bind(this))

    console.log('') // logging empty line
  }

  return report
}
18843
def run(self, raw_args=None):
		
		args = self.parser.parse_args(raw_args)

		core = Core()

		try:
			report = core.lint(**vars(args))
		except Exception as err:
			self.parser.error(str(err))

		print(report)
		self.parser.exit()
390661
def run(self, args):
        

        # run a subprocess and put the stdout and stderr on the pipe object
        try:
            pipe = subprocess.Popen(
                args,
                stdout=subprocess.PIPE, stderr=subprocess.PIPE,
            )
        except OSError as e:
            if e.errno == errno.ENOENT:
                # File not found.
                # This is equivalent to getting exitcode 127 from sh
                raise exceptions.ShellError(
                    ' '.join(args), 127, '', '',
                )

        # pipe.wait() ends up hanging on large files. using
        # pipe.communicate appears to avoid this issue
        stdout, stderr = pipe.communicate()

        # if pipe is busted, raise an error (unlike Fabric)
        if pipe.returncode != 0:
            raise exceptions.ShellError(
                ' '.join(args), pipe.returncode, stdout, stderr,
            )

        return stdout, stderr
402496
def run(input, conf, filepath=None):
    
    if conf.is_file_ignored(filepath):
        return ()

    if isinstance(input, (type(b''), type(u''))):  # compat with Python 2 & 3
        return _run(input, conf, filepath)
    elif hasattr(input, 'read'):  # Python 2's file or Python 3's io.IOBase
        # We need to have everything in memory to parse correctly
        content = input.read()
        return _run(content, conf, filepath)
    else:
        raise TypeError('input should be a string or a stream')