parser-opts.js 715 B

12345678910111213141516171819202122232425
  1. 'use strict'
  2. module.exports = function (config) {
  3. config = defaultConfig(config)
  4. return {
  5. headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
  6. breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
  7. headerCorrespondence: [
  8. 'type',
  9. 'scope',
  10. 'subject'
  11. ],
  12. noteKeywords: ['BREAKING CHANGE', 'BREAKING-CHANGE'],
  13. revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
  14. revertCorrespondence: ['header', 'hash'],
  15. issuePrefixes: config.issuePrefixes
  16. }
  17. }
  18. // merge user set configuration with default configuration.
  19. function defaultConfig (config) {
  20. config = config || {}
  21. config.issuePrefixes = config.issuePrefixes || ['#']
  22. return config
  23. }