function lintMessage()

in scripts/github-pr-title-lint.js [176:200]


function lintMessage(message) {
  if (!message) {
    throw new Error('Unable to lint an empty message.');
  }

  try {
    return execSync('commitlint', {
      input: message,
      windowsHide: true,
      encoding: 'utf-8',
    }).trim();
  } catch (e) {
    // execSync failure or timeouts.
    if (e.error) {
      throw e.error;
    }

    // commitlint non-zero exit
    if (e.status) {
      // stderr by default will be output to the parent process' stderr and so we just throw stdout (See
      // https://nodejs.org/api/child_process.html#child_process_child_process_execsync_command_options)
      throw e.stdout.trim();
    }
  }
}