Writes linter |results| to file.
@param {!string} results Linter results as a string.
@param {!string} filePath Path to the file.
777654
function(results, filePath) {

  var destDir = path.dirname(filePath);

  if (!grunt.file.exists(destDir)) {
    grunt.file.mkdir(destDir);
  }

  grunt.file.write(filePath, results);
  grunt.log.ok('File "' + filePath + '" created.');
}
159732
function format(file, contents) {
  let linter = new tslint.Linter({ fix: true });
  let config = tslint.Configuration.findConfiguration(
    path.resolve(__dirname, '..', 'tslint.json'),
    __filename
  );
  linter.lint(file, contents, config.results);
  let result = linter.getResult();

  if (result.fixes.length === 0) {
    fs.writeFileSync(file, contents, { encoding: 'utf8' });
  }
}
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
161216
function lintDirectory () {
  var shouldFix = args.hasOwnProperty('fix');

  cli = new eslint.CLIEngine({ configFile: configFilePath, fix: shouldFix });

  report = cli.executeOnFiles(dir);

  if (shouldFix) {
    eslint.CLIEngine.outputFixes(report);
  }

  console.log(cli.getFormatter()(report.results)); // eslint-disable-line

  // End with exit code 1 if there are errors
  // Use process.exit instead of throwing to mimic the behaviour of eslints bin
  // We don't want a stacktrace, it would just be confusing
  if (report.errorCount) {
      process.exit(1); // eslint-disable-line
  }
}
1119606
function writeStatsFile(statsFilePath, statsObject, callback) { // eslint-disable-line
  if (typeof statsFilePath !== 'string') {
    return callback();
  }

  if (utils.filenameExtension(statsFilePath) !== 'json') {
    throw new Error('Your stats output file must be a JSON file (i.e. --stats ./stats.json)');
  }

  fs.writeFile(path.resolve(statsFilePath), JSON.stringify(statsObject, null, 2), (writeStatsFileError) => {
    if (writeStatsFileError) {
      throw new Error(`while writting stats JSON file ${statsFilePath}: ${writeStatsFileError}`);
    }

    callback();
  });
}
326788
function writeFile(pathToFile, content, verbose) {
  const directory = path.dirname(pathToFile);

  // Create directory if it doesn't exist
  if (!fs.existsSync(directory)) {
    fs.mkdirSync(directory);
  }

  // Try to write file to disk to the given location
  fs.writeFile(pathToFile, content, { flag: 'w' }, (error) => {
    if (error) {
      throw new Error(error);
    }

    // Log success message to the console if in verbose mode only
    if (verbose) {
      const successMessage = `\nVersion file written to ${chalk.green(pathToFile)}`;

      console.log(successMessage);
    }
  });
}
630269
public void write2File(String filePath) throws Excel4JException {

        try (FileOutputStream fos = new FileOutputStream(filePath)) {
            this.workbook.write(fos);
        } catch (IOException e) {
            throw new Excel4JException(e);
        }
    }
830740
void writeJsFileToJsDir(TypeElement element, ElementVisitor visitor, String packagePath, String fn, String dir) {
		if (null != dir) {
			try (Writer w = fws.getFileObjectWriter(dir + File.separatorChar + "srvs", packagePath + "." + fn)) {
				messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript generation class : " + element + " to : " + dir);
				element.accept(visitor, w);
			} catch (IOException ioe) {
				messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " FAILED TO CREATE : " + packagePath + "." + fn);
			}
		}
	}
1022022
function write(config, filePath) {
    switch (path.extname(filePath)) {
        case ".js":
            writeJSConfigFile(config, filePath);
            break;

        case ".json":
            writeJSONConfigFile(config, filePath);
            break;

        case ".yaml":
        case ".yml":
            writeYAMLConfigFile(config, filePath);
            break;

        default:
            throw new Error("Can't write to unknown file type.");
    }
}
174348
function writeFile(filePath, contents) {
  return new Promise((resolve, reject) => {
    fs.writeFile(filePath, contents, 'utf-8', (err, file) => {
      err ? reject(err) : resolve();
    })
  });
}
965006
function write(data, result, matches) {
    if (data.match(matches.regex)) {
        return data.replace(matches.regex, function () {
            return matches.start + "\n\n```\n" + result + "```\n\n" + matches.end;
        });
    }
    return false;
}
962747
function printReports(filePath, results) {

  let errorCount = 0;
  let warningCount = 0;

  const table = createTable();

  Object.entries(results).forEach(function([ name, reports ]) {

    reports.forEach(function(report) {

      const {
        category,
        id,
        message,
        name: reportName
      } = report;

      table.push(tableEntry({
        category,
        id,
        message,
        name: reportName || name
      }));

      if (category === 'error') {
        errorCount++;
      } else {
        warningCount++;
      }
    });
  });

  const problemCount = warningCount + errorCount;

  if (problemCount) {
    console.log();
    console.log(underline(path.resolve(filePath)));
    console.log(table.toString());
  }

  return {
    errorCount,
    warningCount
  };
}
413355
function writeLog(entries){
    var output = '';

    _.each(entries, function(entry){
        output += entry + '\n';
    });

    return fs.appendFileAsync(this.config.path, output);
}
1293684
function writeToFileStream(fileStream, filePath) {
  return new Promise((resolve, reject) => {
    const writerStream = fs.createWriteStream(filePath)
      .on('finish', () => resolve(filePath))
      .on('error', err => reject(err));
    fileStream.pipe(writerStream);
  });
}
910946
function writeFile(namespace, fileName, fileLocation) {
  var deferred = q.defer();
  // File is already written by middleware
  deferred.resolve(fileLocation);
  return deferred.promise;
}
169885
function passLintResultsThroughReporters(lintResults) {
    const warnings = lintResults
      .reduce((accumulated, res) => accumulated.concat(res.results), []);

    return Promise
      .all(reporters.map(reporter => reporter(warnings)))
      .then(() => lintResults);
  }
769141
def _create_output_from_match(self, match_result):
        """"""
        full_path = match_result['full_path']
        path = self._get_relative_path(full_path)
        return LinterOutput(self.name, path, match_result['msg'])