<commit_before>'use strict';

var fs      = require('fs');
var path    = require('path');
var Promise = require('bluebird');
var temp    = require('temp');
var editor  = require('editor');

module.exports = prMessage;
function prMessage (template, tpTicketId) {
  temp.track();

  return readMessageTemplate(template)
  .then(interpolateTargeProcessId(tpTicketId))
  .then(writeTemporaryFile)
  .then(launchEditor)
  .then(readPullRequestMessage);
}
<commit_msg>Create pull requests messages even without templates<commit_after>'use strict';

var fs      = require('fs');
var path    = require('path');
var Promise = require('bluebird');
var temp    = require('temp');
var editor  = require('editor');

module.exports = prMessage;
function prMessage (template, tpTicketId) {
  temp.track();

  return buildMessageForEditor(template, tpTicketId)
  .then(writeTemporaryFile)
  .then(launchEditor)
  .then(readPullRequestMessage);
}

function buildMessageForEditor (template, tpTicketId) {
  if (template) {
    return readMessageTemplate(template)
    .then(interpolateTargeProcessId(tpTicketId));
  } else {
    return Promise.resolve('');
  }
}

{'fraction_non_alphanumeric': 0.13187772925764193, 'fraction_numerical': 0.0, 'mean_word_length': 5.194594594594594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5689245', 'n_tokens_mistral': 355, 'n_tokens_neox': 354, 'n_words': 78}