<commit_before>"use babel";

import child_process from "child_process";
import path from "path";
import Builder from "../builder";

export default class TexifyBuilder extends Builder {
  constructor() {
    super();
    this.executable = "texify";
  }

  run(filePath) {
    const args = this.constructArgs(filePath);
    const command = `${this.executable} ${args.join(" ")}`;
    const options = this.constructChildProcessOptions();

    options.cwd = path.dirname(filePath); // Run process with sensible CWD.
    options.maxBuffer = 52428800; // Set process' max buffer size to 50 MB.

    return new Promise((resolve) => {
      // TODO: Add support for killing the process.
      child_process.exec(command, options, (error) => {
        resolve((error) ? error.code : 0);
      });
    });
  }

  constructArgs(filePath) {
    const args = [
      "--batch",
      "--pdf",
      "--tex-option=--synctex=1",
      "--tex-option=--max-print-line=1000", // Max log file line length
    ];

    const enableShellEscape = atom.config.get("latex.enableShellEscape");
    if (enableShellEscape) {
      args.push("--tex-option=--enable-write18");
    }

    const customEngine = atom.config.get("latex.customEngine");
    const engine = atom.config.get("latex.engine");
    if (customEngine || engine !== "pdflatex") {
      atom.notifications.addWarning(
        "Engine customization is not supported by texify, " +
        "so this functionality is disabled when using the texify builder."
      );
    }

    let outdir = this.getOutputDirectory(filePath);
    if (outdir) {
      atom.notifications.addWarning(
        "Output directory functionality is poorly supported by texify, " +
        "so this functionality is disabled (for the foreseeable future) " +
        "when using the texify builder."
      );
    }

    args.push(`\"${filePath}\"`);
    return args;
  }
}
<commit_msg>:shirt: Move comment to work around linter bug<commit_after>"use babel";

import child_process from "child_process";
import path from "path";
import Builder from "../builder";

export default class TexifyBuilder extends Builder {
  constructor() {
    super();
    this.executable = "texify";
  }

  run(filePath) {
    const args = this.constructArgs(filePath);
    const command = `${this.executable} ${args.join(" ")}`;
    const options = this.constructChildProcessOptions();

    options.cwd = path.dirname(filePath); // Run process with sensible CWD.
    options.maxBuffer = 52428800; // Set process' max buffer size to 50 MB.

    return new Promise((resolve) => {
      // TODO: Add support for killing the process.
      child_process.exec(command, options, (error) => {
        resolve((error) ? error.code : 0);
      });
    });
  }

  constructArgs(filePath) {
    const args = [
      "--batch",
      "--pdf",
      "--tex-option=--synctex=1",
      // Set logfile max line length.
      "--tex-option=--max-print-line=1000",
    ];

    const enableShellEscape = atom.config.get("latex.enableShellEscape");
    if (enableShellEscape) {
      args.push("--tex-option=--enable-write18");
    }

    const customEngine = atom.config.get("latex.customEngine");
    const engine = atom.config.get("latex.engine");
    if (customEngine || engine !== "pdflatex") {
      atom.notifications.addWarning(
        "Engine customization is not supported by texify, " +
        "so this functionality is disabled when using the texify builder."
      );
    }

    let outdir = this.getOutputDirectory(filePath);
    if (outdir) {
      atom.notifications.addWarning(
        "Output directory functionality is poorly supported by texify, " +
        "so this functionality is disabled (for the foreseeable future) " +
        "when using the texify builder."
      );
    }

    args.push(`\"${filePath}\"`);
    return args;
  }
}

{'fraction_non_alphanumeric': 0.1365891877774876, 'fraction_numerical': 0.009401932619482894, 'mean_word_length': 2.810945273631841, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5358342', 'n_tokens_mistral': 1152, 'n_tokens_neox': 1107, 'n_words': 297}