From b9468c444812a1153175af418f3323a6e70aa266 Mon Sep 17 00:00:00 2001 From: Marko Ristin Date: Wed, 20 Apr 2022 08:44:08 +0200 Subject: [PATCH] Add "group" to the list of verbs (#106) Examples: * Group functions by their domain * Group classes by their target --- dist/index.js | 2724 ++++++++++++++++--------------- src/mostFrequentEnglishVerbs.ts | 3 +- 2 files changed, 1365 insertions(+), 1362 deletions(-) diff --git a/dist/index.js b/dist/index.js index ee7307a..bf6f9cc 100644 --- a/dist/index.js +++ b/dist/index.js @@ -254,29 +254,29 @@ exports.issueCommand = issueCommand; /***/ (function(__unusedmodule, exports) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.formatErrors = void 0; -function formatErrors(message, messageIndex, errors) { - if (errors.length === 0) { - throw Error('Unexpected empty errors'); - } - // Parts of the representation to be joined by '' - const parts = []; - parts.push(`The message ${messageIndex + 1} is invalid:\n`); - for (const error of errors) { - if (error.endsWith('\n')) { - throw Error(`Unexpected error ending in a new-line character: ${error}`); - } - parts.push(`* ${error}\n`); - } - parts.push(`The original message was:\n${message}`); - if (!message.endsWith('\n')) { - parts.push('\n'); - } - return parts.join(''); -} -exports.formatErrors = formatErrors; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.formatErrors = void 0; +function formatErrors(message, messageIndex, errors) { + if (errors.length === 0) { + throw Error('Unexpected empty errors'); + } + // Parts of the representation to be joined by '' + const parts = []; + parts.push(`The message ${messageIndex + 1} is invalid:\n`); + for (const error of errors) { + if (error.endsWith('\n')) { + throw Error(`Unexpected error ending in a new-line character: ${error}`); + } + parts.push(`* ${error}\n`); + } + parts.push(`The original message was:\n${message}`); + if (!message.endsWith('\n')) { + parts.push('\n'); + } + return parts.join(''); +} +exports.formatErrors = formatErrors; /***/ }), @@ -285,274 +285,274 @@ exports.formatErrors = formatErrors; /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.check = void 0; -const mostFrequentEnglishVerbs = __importStar(__webpack_require__(538)); -function splitLines(message) { - const lines = message.split('\n'); - for (let i = 0; i < lines.length; i++) { - lines[i] = lines[i].replace(/\r$/, ''); - } - return lines; -} -function splitSubjectBody(lines) { - const result = { errors: [] }; - if (lines.length === 0 || lines.length === 1) { - result.errors.push('Expected at least three lines (subject, empty, body), ' + - `but got: ${lines.length}`); - return result; - } - else if (lines.length === 2) { - result.errors.push('Expected at least three lines (subject, empty, body) ' + - `in a multi-line message, but got: ${lines.length}`); - return result; - } - if (lines[1].length !== 0) { - result.errors.push(`Expected an empty line between the subject and the body, ` + - `but got a second line of length: ${lines[1].length}`); - } - result.subjectBody = { subject: lines[0], bodyLines: lines.slice(2) }; - return result; -} -const allLettersRe = new RegExp('^[a-zA-Z][a-zA-Z-]+$'); -const firstWordBeforeSpaceRe = new RegExp('^([a-zA-Z][a-zA-Z-]+)\\s'); -const suffixHashCodeRe = new RegExp('\\s?\\(\\s*#[a-zA-Z_0-9]+\\s*\\)$'); -function extractFirstWord(text) { - if (text.length === 0) { - return null; - } - if (text.match(allLettersRe)) { - return text; - } - else { - const match = firstWordBeforeSpaceRe.exec(text); - if (!match) { - return null; - } - return match[1]; - } -} -function capitalize(word) { - if (word.length === 0) { - return ''; - } - else if (word.length === 1) { - return word.toUpperCase(); - } - else { - return word[0].toUpperCase() + word.slice(1).toLowerCase(); - } -} -function errorMessageOnNonVerb(firstWord, inputs) { - const parts = [ - 'The subject must start with a verb in imperative mood, ' + - `but it started with: ${JSON.stringify(firstWord)}. ` + - 'Whether the word is in imperative mood is determined by ' + - 'whitelisting. The general whitelist is available at ' + - 'https://github.com/mristin/opinionated-commit-message/' + - 'blob/master/src/mostFrequentEnglishVerbs.ts.' - ]; - if (!inputs.hasAdditionalVerbsInput) { - parts.push('You can whitelist additional verbs using ' + - '"additional-verbs" input to your GitHub action ' + - '(currently no additional verbs were thus specified).'); - } - else { - parts.push('You can whitelist additional verbs using ' + - '"additional-verbs" input to your GitHub action ' + - `(currently one or more additional verbs were thus ` + - 'specified).'); - } - if (inputs.pathToAdditionalVerbs.length === 0) { - parts.push('Moreover, you can also whitelist additional verbs in a file ' + - 'given as "path-to-additional-verbs" input to your GitHub action ' + - '(currently no whitelist file was specified).'); - } - else { - parts.push('Moreover, you can also whitelist additional verbs in a file ' + - 'given as "path-to-additional-verbs" input to your GitHub action ' + - `(currently the file is: ${inputs.pathToAdditionalVerbs}).`); - } - parts.push('Please check the whitelist and either change the first word ' + - 'of the subject or whitelist the verb.'); - return parts.join(' '); -} -function checkSubject(subject, inputs) { - // Pre-condition - for (const verb of inputs.additionalVerbs) { - if (verb.length === 0) { - throw new Error(`Unexpected empty additional verb`); - } - if (verb !== verb.toLowerCase()) { - throw new Error(`All additional verbs expected in lower case, but got: ${verb}`); - } - } - const errors = []; - // Tolerate the hash code referring, e.g., to a pull request. - // These hash codes are usually added automatically by GitHub and - // similar services. - const subjectWoCode = subject.replace(suffixHashCodeRe, ''); - if (subjectWoCode.length > inputs.maxSubjectLength) { - errors.push(`The subject exceeds the limit of ${inputs.maxSubjectLength} characters ` + - `(got: ${subject.length}, JSON: ${JSON.stringify(subjectWoCode)}).` + - 'Please shorten the subject to make it more succinct.'); - } - const firstWord = extractFirstWord(subjectWoCode); - if (!firstWord) { - errors.push('Expected the subject to start with a verb in imperative mood ' + - 'consisting of letters and possibly dashes in-between, ' + - `but the subject was: ${JSON.stringify(subjectWoCode)}. ` + - 'Please re-write the subject so that it starts with ' + - 'a verb in imperative mood.'); - } - else { - const capitalized = capitalize(firstWord); - if (firstWord !== capitalized) { - errors.push('The subject must start with a capitalized word, ' + - `but the current first word is: ${JSON.stringify(firstWord)}. ` + - `Please capitalize to: ${JSON.stringify(capitalized)}.`); - } - if (!mostFrequentEnglishVerbs.SET.has(firstWord.toLowerCase()) && - !inputs.additionalVerbs.has(firstWord.toLowerCase())) { - /* - (mristin, 2020-09-09): It might be worthwhile to refactor the rendering - of the error messages to a separate module and use classes to represent - the errors. The complexity is still manageable, so it is not yet the - moment to do so since the refactoring would be quite time-consuming. - - Originally, I did not foresee that error messages need such a large - information content. - */ - errors.push(errorMessageOnNonVerb(firstWord, inputs)); - } - } - if (subjectWoCode.endsWith('.')) { - errors.push("The subject must not end with a dot ('.'). " + - 'Please remove the trailing dot(s).'); - } - return errors; -} -const urlLineRe = new RegExp('^[^ ]+://[^ ]+$'); -const linkDefinitionRe = new RegExp('^\\[[^\\]]+]\\s*:\\s*[^ ]+://[^ ]+$'); -function checkBody(subject, bodyLines, inputs) { - const errors = []; - if (bodyLines.length === 0) { - errors.push('At least one line is expected in the body, but got empty body.'); - return errors; - } - if (bodyLines.length === 1 && bodyLines[0].trim() === '') { - errors.push('Unexpected empty body'); - return errors; - } - for (const [i, line] of bodyLines.entries()) { - if (urlLineRe.test(line) || linkDefinitionRe.test(line)) { - continue; - } - if (line.length > inputs.maxBodyLineLength) { - errors.push(`The line ${i + 3} of the message (line ${i + 1} of the body) ` + - `exceeds the limit of ${inputs.maxBodyLineLength} characters. ` + - `The line contains ${line.length} characters: ` + - `${JSON.stringify(line)}. ` + - 'Please reformat the body so that all the lines fit ' + - `${inputs.maxBodyLineLength} characters.`); - } - } - const bodyFirstWord = extractFirstWord(bodyLines[0]); - if (bodyFirstWord) { - const subjectFirstWord = extractFirstWord(subject); - if (subjectFirstWord) { - if (subjectFirstWord.toLowerCase() === bodyFirstWord.toLowerCase()) { - errors.push('The first word of the subject ' + - `(${JSON.stringify(subjectFirstWord)}) ` + - 'must not match the first word of the body. ' + - 'Please make the body more informative by adding more ' + - 'information instead of repeating the subject. ' + - 'For example, start by explaining the problem that this change ' + - 'is intended to solve or what was previously missing ' + - '(e.g., "Previously, ....").'); - } - } - } - return errors; -} -const signedOffByRe = new RegExp('^\\s*Signed-off-by:\\s*[^<]+\\s*<[^@>, ]+@[^@>, ]+>\\s*$'); -function checkSignedOff(bodyLines) { - const errors = []; - let matches = 0; - for (const line of bodyLines) { - if (signedOffByRe.test(line)) { - matches++; - } - } - if (matches === 0) { - errors.push("The body does not contain any 'Signed-off-by: ' line. " + - 'Did you sign off the commit with `git commit --signoff`?'); - } - return errors; -} -const mergeMessageRe = new RegExp("^Merge branch '[^\\000-\\037\\177 ~^:?*[]+' " + - 'into [^\\000-\\037\\177 ~^:?*[]+$'); -function check(message, inputs) { - const errors = []; - if (mergeMessageRe.test(message)) { - return errors; - } - const lines = splitLines(message); - if (lines.length === 0) { - errors.push(`The message is empty.`); - return errors; - } - else if (lines.length === 1 && inputs.allowOneLiners) { - errors.push(...checkSubject(lines[0], inputs)); - } - else { - const maybeSubjectBody = splitSubjectBody(lines); - if (maybeSubjectBody.errors.length > 0) { - errors.push(...maybeSubjectBody.errors); - } - else { - if (maybeSubjectBody.subjectBody === undefined) { - throw Error('Unexpected undefined subjectBody'); - } - const subjectBody = maybeSubjectBody.subjectBody; - errors.push(...checkSubject(subjectBody.subject, inputs)); - if (!inputs.skipBodyCheck) { - errors.push(...checkBody(subjectBody.subject, subjectBody.bodyLines, inputs)); - } - if (inputs.enforceSignOff) { - errors.push(...checkSignedOff(subjectBody.bodyLines)); - } - } - } - // Post-condition - for (const error of errors) { - if (error.endsWith('\n')) { - throw Error(`Unexpected error ending in a new-line character: ${error}`); - } - } - return errors; -} -exports.check = check; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.check = void 0; +const mostFrequentEnglishVerbs = __importStar(__webpack_require__(538)); +function splitLines(message) { + const lines = message.split('\n'); + for (let i = 0; i < lines.length; i++) { + lines[i] = lines[i].replace(/\r$/, ''); + } + return lines; +} +function splitSubjectBody(lines) { + const result = { errors: [] }; + if (lines.length === 0 || lines.length === 1) { + result.errors.push('Expected at least three lines (subject, empty, body), ' + + `but got: ${lines.length}`); + return result; + } + else if (lines.length === 2) { + result.errors.push('Expected at least three lines (subject, empty, body) ' + + `in a multi-line message, but got: ${lines.length}`); + return result; + } + if (lines[1].length !== 0) { + result.errors.push(`Expected an empty line between the subject and the body, ` + + `but got a second line of length: ${lines[1].length}`); + } + result.subjectBody = { subject: lines[0], bodyLines: lines.slice(2) }; + return result; +} +const allLettersRe = new RegExp('^[a-zA-Z][a-zA-Z-]+$'); +const firstWordBeforeSpaceRe = new RegExp('^([a-zA-Z][a-zA-Z-]+)\\s'); +const suffixHashCodeRe = new RegExp('\\s?\\(\\s*#[a-zA-Z_0-9]+\\s*\\)$'); +function extractFirstWord(text) { + if (text.length === 0) { + return null; + } + if (text.match(allLettersRe)) { + return text; + } + else { + const match = firstWordBeforeSpaceRe.exec(text); + if (!match) { + return null; + } + return match[1]; + } +} +function capitalize(word) { + if (word.length === 0) { + return ''; + } + else if (word.length === 1) { + return word.toUpperCase(); + } + else { + return word[0].toUpperCase() + word.slice(1).toLowerCase(); + } +} +function errorMessageOnNonVerb(firstWord, inputs) { + const parts = [ + 'The subject must start with a verb in imperative mood, ' + + `but it started with: ${JSON.stringify(firstWord)}. ` + + 'Whether the word is in imperative mood is determined by ' + + 'whitelisting. The general whitelist is available at ' + + 'https://github.com/mristin/opinionated-commit-message/' + + 'blob/master/src/mostFrequentEnglishVerbs.ts.' + ]; + if (!inputs.hasAdditionalVerbsInput) { + parts.push('You can whitelist additional verbs using ' + + '"additional-verbs" input to your GitHub action ' + + '(currently no additional verbs were thus specified).'); + } + else { + parts.push('You can whitelist additional verbs using ' + + '"additional-verbs" input to your GitHub action ' + + `(currently one or more additional verbs were thus ` + + 'specified).'); + } + if (inputs.pathToAdditionalVerbs.length === 0) { + parts.push('Moreover, you can also whitelist additional verbs in a file ' + + 'given as "path-to-additional-verbs" input to your GitHub action ' + + '(currently no whitelist file was specified).'); + } + else { + parts.push('Moreover, you can also whitelist additional verbs in a file ' + + 'given as "path-to-additional-verbs" input to your GitHub action ' + + `(currently the file is: ${inputs.pathToAdditionalVerbs}).`); + } + parts.push('Please check the whitelist and either change the first word ' + + 'of the subject or whitelist the verb.'); + return parts.join(' '); +} +function checkSubject(subject, inputs) { + // Pre-condition + for (const verb of inputs.additionalVerbs) { + if (verb.length === 0) { + throw new Error(`Unexpected empty additional verb`); + } + if (verb !== verb.toLowerCase()) { + throw new Error(`All additional verbs expected in lower case, but got: ${verb}`); + } + } + const errors = []; + // Tolerate the hash code referring, e.g., to a pull request. + // These hash codes are usually added automatically by GitHub and + // similar services. + const subjectWoCode = subject.replace(suffixHashCodeRe, ''); + if (subjectWoCode.length > inputs.maxSubjectLength) { + errors.push(`The subject exceeds the limit of ${inputs.maxSubjectLength} characters ` + + `(got: ${subject.length}, JSON: ${JSON.stringify(subjectWoCode)}).` + + 'Please shorten the subject to make it more succinct.'); + } + const firstWord = extractFirstWord(subjectWoCode); + if (!firstWord) { + errors.push('Expected the subject to start with a verb in imperative mood ' + + 'consisting of letters and possibly dashes in-between, ' + + `but the subject was: ${JSON.stringify(subjectWoCode)}. ` + + 'Please re-write the subject so that it starts with ' + + 'a verb in imperative mood.'); + } + else { + const capitalized = capitalize(firstWord); + if (firstWord !== capitalized) { + errors.push('The subject must start with a capitalized word, ' + + `but the current first word is: ${JSON.stringify(firstWord)}. ` + + `Please capitalize to: ${JSON.stringify(capitalized)}.`); + } + if (!mostFrequentEnglishVerbs.SET.has(firstWord.toLowerCase()) && + !inputs.additionalVerbs.has(firstWord.toLowerCase())) { + /* + (mristin, 2020-09-09): It might be worthwhile to refactor the rendering + of the error messages to a separate module and use classes to represent + the errors. The complexity is still manageable, so it is not yet the + moment to do so since the refactoring would be quite time-consuming. + + Originally, I did not foresee that error messages need such a large + information content. + */ + errors.push(errorMessageOnNonVerb(firstWord, inputs)); + } + } + if (subjectWoCode.endsWith('.')) { + errors.push("The subject must not end with a dot ('.'). " + + 'Please remove the trailing dot(s).'); + } + return errors; +} +const urlLineRe = new RegExp('^[^ ]+://[^ ]+$'); +const linkDefinitionRe = new RegExp('^\\[[^\\]]+]\\s*:\\s*[^ ]+://[^ ]+$'); +function checkBody(subject, bodyLines, inputs) { + const errors = []; + if (bodyLines.length === 0) { + errors.push('At least one line is expected in the body, but got empty body.'); + return errors; + } + if (bodyLines.length === 1 && bodyLines[0].trim() === '') { + errors.push('Unexpected empty body'); + return errors; + } + for (const [i, line] of bodyLines.entries()) { + if (urlLineRe.test(line) || linkDefinitionRe.test(line)) { + continue; + } + if (line.length > inputs.maxBodyLineLength) { + errors.push(`The line ${i + 3} of the message (line ${i + 1} of the body) ` + + `exceeds the limit of ${inputs.maxBodyLineLength} characters. ` + + `The line contains ${line.length} characters: ` + + `${JSON.stringify(line)}. ` + + 'Please reformat the body so that all the lines fit ' + + `${inputs.maxBodyLineLength} characters.`); + } + } + const bodyFirstWord = extractFirstWord(bodyLines[0]); + if (bodyFirstWord) { + const subjectFirstWord = extractFirstWord(subject); + if (subjectFirstWord) { + if (subjectFirstWord.toLowerCase() === bodyFirstWord.toLowerCase()) { + errors.push('The first word of the subject ' + + `(${JSON.stringify(subjectFirstWord)}) ` + + 'must not match the first word of the body. ' + + 'Please make the body more informative by adding more ' + + 'information instead of repeating the subject. ' + + 'For example, start by explaining the problem that this change ' + + 'is intended to solve or what was previously missing ' + + '(e.g., "Previously, ....").'); + } + } + } + return errors; +} +const signedOffByRe = new RegExp('^\\s*Signed-off-by:\\s*[^<]+\\s*<[^@>, ]+@[^@>, ]+>\\s*$'); +function checkSignedOff(bodyLines) { + const errors = []; + let matches = 0; + for (const line of bodyLines) { + if (signedOffByRe.test(line)) { + matches++; + } + } + if (matches === 0) { + errors.push("The body does not contain any 'Signed-off-by: ' line. " + + 'Did you sign off the commit with `git commit --signoff`?'); + } + return errors; +} +const mergeMessageRe = new RegExp("^Merge branch '[^\\000-\\037\\177 ~^:?*[]+' " + + 'into [^\\000-\\037\\177 ~^:?*[]+$'); +function check(message, inputs) { + const errors = []; + if (mergeMessageRe.test(message)) { + return errors; + } + const lines = splitLines(message); + if (lines.length === 0) { + errors.push(`The message is empty.`); + return errors; + } + else if (lines.length === 1 && inputs.allowOneLiners) { + errors.push(...checkSubject(lines[0], inputs)); + } + else { + const maybeSubjectBody = splitSubjectBody(lines); + if (maybeSubjectBody.errors.length > 0) { + errors.push(...maybeSubjectBody.errors); + } + else { + if (maybeSubjectBody.subjectBody === undefined) { + throw Error('Unexpected undefined subjectBody'); + } + const subjectBody = maybeSubjectBody.subjectBody; + errors.push(...checkSubject(subjectBody.subject, inputs)); + if (!inputs.skipBodyCheck) { + errors.push(...checkBody(subjectBody.subject, subjectBody.bodyLines, inputs)); + } + if (inputs.enforceSignOff) { + errors.push(...checkSignedOff(subjectBody.bodyLines)); + } + } + } + // Post-condition + for (const error of errors) { + if (error.endsWith('\n')) { + throw Error(`Unexpected error ending in a new-line character: ${error}`); + } + } + return errors; +} +exports.check = check; /***/ }), @@ -611,29 +611,29 @@ exports.getApiBaseUrl = getApiBaseUrl; /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const mainImpl = __importStar(__webpack_require__(338)); -mainImpl.run(); + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const mainImpl = __importStar(__webpack_require__(338)); +mainImpl.run(); /***/ }), @@ -1259,124 +1259,124 @@ exports.Context = Context; /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; - -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.parseVerbs = exports.parseInputs = exports.MaybeInputs = exports.Inputs = void 0; -const fs_1 = __importDefault(__webpack_require__(747)); -class Inputs { - constructor(hasAdditionalVerbsInput, pathToAdditionalVerbs, allowOneLiners, additionalVerbs, maxSubjectLength, maxBodyLineLength, enforceSignOff, skipBodyCheck) { - this.hasAdditionalVerbsInput = hasAdditionalVerbsInput; - this.pathToAdditionalVerbs = pathToAdditionalVerbs; - this.allowOneLiners = allowOneLiners; - this.additionalVerbs = additionalVerbs; - this.maxSubjectLength = maxSubjectLength; - this.maxBodyLineLength = maxBodyLineLength; - this.enforceSignOff = enforceSignOff; - this.skipBodyCheck = skipBodyCheck; - } -} -exports.Inputs = Inputs; -class MaybeInputs { - constructor(inputs, error) { - if (inputs === null && error === null) { - throw Error("Unexpected both 'inputs' and 'error' arguments to be null."); - } - if (inputs !== null && error !== null) { - throw Error("Unexpected both 'inputs' and 'error' arguments to be given."); - } - this.inputs = inputs; - this.error = error; - } - mustInputs() { - if (this.inputs === null) { - throw Error("The field 'inputs' is expected to be set, but it is null. " + - `The field 'error' is: ${this.error}`); - } - return this.inputs; - } -} -exports.MaybeInputs = MaybeInputs; -function parseInputs(additionalVerbsInput, pathToAdditionalVerbsInput, allowOneLinersInput, maxSubjectLengthInput, maxBodyLineLengthInput, enforceSignOffInput, skipBodyCheckInput) { - const additionalVerbs = new Set(); - const hasAdditionalVerbsInput = additionalVerbsInput.length > 0; - if (additionalVerbsInput) { - for (const verb of parseVerbs(additionalVerbsInput)) { - additionalVerbs.add(verb); - } - } - if (pathToAdditionalVerbsInput) { - if (!fs_1.default.existsSync(pathToAdditionalVerbsInput)) { - return new MaybeInputs(null, 'The file referenced by path-to-additional-verbs could ' + - `not be found: ${pathToAdditionalVerbsInput}`); - } - const text = fs_1.default.readFileSync(pathToAdditionalVerbsInput).toString('utf-8'); - for (const verb of parseVerbs(text)) { - additionalVerbs.add(verb); - } - } - const allowOneLiners = !allowOneLinersInput - ? false - : parseBooleanFromString(allowOneLinersInput); - if (allowOneLiners === null) { - return new MaybeInputs(null, 'Unexpected value for allow-one-liners. ' + - `Expected either 'true' or 'false', got: ${allowOneLinersInput}`); - } - const maxSubjectLength = !maxSubjectLengthInput - ? 50 - : parseInt(maxSubjectLengthInput, 10); - if (Number.isNaN(maxSubjectLength)) { - return new MaybeInputs(null, 'Unexpected value for max-subject-line-length. ' + - `Expected a number or nothing, got ${maxSubjectLengthInput}`); - } - const maxBodyLineLength = !maxBodyLineLengthInput - ? 72 - : parseInt(maxBodyLineLengthInput, 10); - if (Number.isNaN(maxBodyLineLength)) { - return new MaybeInputs(null, 'Unexpected value for max-body-line-length. ' + - `Expected a number or nothing, got ${maxBodyLineLengthInput}`); - } - const enforceSignOff = !enforceSignOffInput - ? false - : parseBooleanFromString(enforceSignOffInput); - if (enforceSignOff === null) { - return new MaybeInputs(null, 'Unexpected value for enforce-sign-off. ' + - `Expected either 'true' or 'false', got: ${enforceSignOffInput}`); - } - const skipBodyCheck = !skipBodyCheckInput - ? false - : parseBooleanFromString(skipBodyCheckInput); - if (skipBodyCheck === null) { - return new MaybeInputs(null, 'Unexpected value for skip-body-check. ' + - `Expected either 'true' or 'false', got: ${skipBodyCheckInput}`); - } - return new MaybeInputs(new Inputs(hasAdditionalVerbsInput, pathToAdditionalVerbsInput, allowOneLiners, additionalVerbs, maxSubjectLength, maxBodyLineLength, enforceSignOff, skipBodyCheck), null); -} -exports.parseInputs = parseInputs; -function parseVerbs(text) { - const lines = text.split('\n'); - const verbs = []; - for (const line of lines) { - const lineVerbs = line - .split(/[,;]/) - .map(verb => verb.trim().toLowerCase()) - .filter(verb => verb.length > 0); - verbs.push(...lineVerbs); - } - return verbs; -} -exports.parseVerbs = parseVerbs; -function parseBooleanFromString(text) { - if (text === '' || text.toLowerCase() === 'false' || text === '0') { - return false; - } - if (text.toLowerCase() === 'true' || text === '1') { - return true; - } - return null; -} + +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.parseVerbs = exports.parseInputs = exports.MaybeInputs = exports.Inputs = void 0; +const fs_1 = __importDefault(__webpack_require__(747)); +class Inputs { + constructor(hasAdditionalVerbsInput, pathToAdditionalVerbs, allowOneLiners, additionalVerbs, maxSubjectLength, maxBodyLineLength, enforceSignOff, skipBodyCheck) { + this.hasAdditionalVerbsInput = hasAdditionalVerbsInput; + this.pathToAdditionalVerbs = pathToAdditionalVerbs; + this.allowOneLiners = allowOneLiners; + this.additionalVerbs = additionalVerbs; + this.maxSubjectLength = maxSubjectLength; + this.maxBodyLineLength = maxBodyLineLength; + this.enforceSignOff = enforceSignOff; + this.skipBodyCheck = skipBodyCheck; + } +} +exports.Inputs = Inputs; +class MaybeInputs { + constructor(inputs, error) { + if (inputs === null && error === null) { + throw Error("Unexpected both 'inputs' and 'error' arguments to be null."); + } + if (inputs !== null && error !== null) { + throw Error("Unexpected both 'inputs' and 'error' arguments to be given."); + } + this.inputs = inputs; + this.error = error; + } + mustInputs() { + if (this.inputs === null) { + throw Error("The field 'inputs' is expected to be set, but it is null. " + + `The field 'error' is: ${this.error}`); + } + return this.inputs; + } +} +exports.MaybeInputs = MaybeInputs; +function parseInputs(additionalVerbsInput, pathToAdditionalVerbsInput, allowOneLinersInput, maxSubjectLengthInput, maxBodyLineLengthInput, enforceSignOffInput, skipBodyCheckInput) { + const additionalVerbs = new Set(); + const hasAdditionalVerbsInput = additionalVerbsInput.length > 0; + if (additionalVerbsInput) { + for (const verb of parseVerbs(additionalVerbsInput)) { + additionalVerbs.add(verb); + } + } + if (pathToAdditionalVerbsInput) { + if (!fs_1.default.existsSync(pathToAdditionalVerbsInput)) { + return new MaybeInputs(null, 'The file referenced by path-to-additional-verbs could ' + + `not be found: ${pathToAdditionalVerbsInput}`); + } + const text = fs_1.default.readFileSync(pathToAdditionalVerbsInput).toString('utf-8'); + for (const verb of parseVerbs(text)) { + additionalVerbs.add(verb); + } + } + const allowOneLiners = !allowOneLinersInput + ? false + : parseBooleanFromString(allowOneLinersInput); + if (allowOneLiners === null) { + return new MaybeInputs(null, 'Unexpected value for allow-one-liners. ' + + `Expected either 'true' or 'false', got: ${allowOneLinersInput}`); + } + const maxSubjectLength = !maxSubjectLengthInput + ? 50 + : parseInt(maxSubjectLengthInput, 10); + if (Number.isNaN(maxSubjectLength)) { + return new MaybeInputs(null, 'Unexpected value for max-subject-line-length. ' + + `Expected a number or nothing, got ${maxSubjectLengthInput}`); + } + const maxBodyLineLength = !maxBodyLineLengthInput + ? 72 + : parseInt(maxBodyLineLengthInput, 10); + if (Number.isNaN(maxBodyLineLength)) { + return new MaybeInputs(null, 'Unexpected value for max-body-line-length. ' + + `Expected a number or nothing, got ${maxBodyLineLengthInput}`); + } + const enforceSignOff = !enforceSignOffInput + ? false + : parseBooleanFromString(enforceSignOffInput); + if (enforceSignOff === null) { + return new MaybeInputs(null, 'Unexpected value for enforce-sign-off. ' + + `Expected either 'true' or 'false', got: ${enforceSignOffInput}`); + } + const skipBodyCheck = !skipBodyCheckInput + ? false + : parseBooleanFromString(skipBodyCheckInput); + if (skipBodyCheck === null) { + return new MaybeInputs(null, 'Unexpected value for skip-body-check. ' + + `Expected either 'true' or 'false', got: ${skipBodyCheckInput}`); + } + return new MaybeInputs(new Inputs(hasAdditionalVerbsInput, pathToAdditionalVerbsInput, allowOneLiners, additionalVerbs, maxSubjectLength, maxBodyLineLength, enforceSignOff, skipBodyCheck), null); +} +exports.parseInputs = parseInputs; +function parseVerbs(text) { + const lines = text.split('\n'); + const verbs = []; + for (const line of lines) { + const lineVerbs = line + .split(/[,;]/) + .map(verb => verb.trim().toLowerCase()) + .filter(verb => verb.length > 0); + verbs.push(...lineVerbs); + } + return verbs; +} +exports.parseVerbs = parseVerbs; +function parseBooleanFromString(text) { + if (text === '' || text.toLowerCase() === 'false' || text === '0') { + return false; + } + if (text.toLowerCase() === 'true' || text === '1') { + return true; + } + return null; +} /***/ }), @@ -1419,76 +1419,76 @@ function register(state, name, method, options) { /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.retrieve = void 0; -const github = __importStar(__webpack_require__(469)); -// This code has been taken from https://github.com/GsActions/commit-message-checker/blob/master/src/input-helper.ts -// and slightly modified. -/** - * Gets all commit messages of a push or title and body of a pull request - * concatenated to one message. - * - * @returns string[] - */ -function retrieve() { - var _a, _b; - const result = []; - switch (github.context.eventName) { - case 'pull_request': { - const pullRequest = (_a = github.context.payload) === null || _a === void 0 ? void 0 : _a.pull_request; - if (pullRequest) { - let msg = pullRequest.title; - if (pullRequest.body) { - msg = msg.concat('\n\n', pullRequest.body); - } - result.push(msg); - } - else { - throw new Error(`No pull_request found in the payload.`); - } - break; - } - case 'push': { - const commits = (_b = github.context.payload) === null || _b === void 0 ? void 0 : _b.commits; - if (commits) { - for (const commit of commits) { - if (commit.message) { - result.push(commit.message); - } - } - } - if (result.length === 0) { - throw new Error(`No commits found in the payload.`); - } - break; - } - default: { - throw new Error(`Unhandled event: ${github.context.eventName}`); - } - } - return result; -} -exports.retrieve = retrieve; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.retrieve = void 0; +const github = __importStar(__webpack_require__(469)); +// This code has been taken from https://github.com/GsActions/commit-message-checker/blob/master/src/input-helper.ts +// and slightly modified. +/** + * Gets all commit messages of a push or title and body of a pull request + * concatenated to one message. + * + * @returns string[] + */ +function retrieve() { + var _a, _b; + const result = []; + switch (github.context.eventName) { + case 'pull_request': { + const pullRequest = (_a = github.context.payload) === null || _a === void 0 ? void 0 : _a.pull_request; + if (pullRequest) { + let msg = pullRequest.title; + if (pullRequest.body) { + msg = msg.concat('\n\n', pullRequest.body); + } + result.push(msg); + } + else { + throw new Error(`No pull_request found in the payload.`); + } + break; + } + case 'push': { + const commits = (_b = github.context.payload) === null || _b === void 0 ? void 0 : _b.commits; + if (commits) { + for (const commit of commits) { + if (commit.message) { + result.push(commit.message); + } + } + } + if (result.length === 0) { + throw new Error(`No commits found in the payload.`); + } + break; + } + default: { + throw new Error(`Unhandled event: ${github.context.eventName}`); + } + } + return result; +} +exports.retrieve = retrieve; /***/ }), @@ -1722,86 +1722,86 @@ exports.paginatingEndpoints = paginatingEndpoints; /***/ (function(__unusedmodule, exports, __webpack_require__) { "use strict"; - -var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); -}) : (function(o, m, k, k2) { - if (k2 === undefined) k2 = k; - o[k2] = m[k]; -})); -var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { - Object.defineProperty(o, "default", { enumerable: true, value: v }); -}) : function(o, v) { - o["default"] = v; -}); -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); - __setModuleDefault(result, mod); - return result; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.run = void 0; -const core = __importStar(__webpack_require__(470)); -const commitMessages = __importStar(__webpack_require__(281)); -const inspection = __importStar(__webpack_require__(117)); -const represent = __importStar(__webpack_require__(110)); -const input = __importStar(__webpack_require__(265)); -function runWithExceptions() { - var _a, _b, _c, _d, _e, _f, _g; - const messages = commitMessages.retrieve(); - //// - // Parse inputs - //// - const additionalVerbsInput = (_a = core.getInput('additional-verbs', { required: false })) !== null && _a !== void 0 ? _a : ''; - const pathToAdditionalVerbsInput = (_b = core.getInput('path-to-additional-verbs', { required: false })) !== null && _b !== void 0 ? _b : ''; - const allowOneLinersInput = (_c = core.getInput('allow-one-liners', { required: false })) !== null && _c !== void 0 ? _c : ''; - const maxSubjectLengthInput = (_d = core.getInput('max-subject-line-length', { required: false })) !== null && _d !== void 0 ? _d : ''; - const maxBodyLineLengthInput = (_e = core.getInput('max-body-line-length', { required: false })) !== null && _e !== void 0 ? _e : ''; - const enforceSignOffInput = (_f = core.getInput('enforce-sign-off', { required: false })) !== null && _f !== void 0 ? _f : ''; - const skipBodyCheckInput = (_g = core.getInput('skip-body-check', { required: false })) !== null && _g !== void 0 ? _g : ''; - const maybeInputs = input.parseInputs(additionalVerbsInput, pathToAdditionalVerbsInput, allowOneLinersInput, maxSubjectLengthInput, maxBodyLineLengthInput, enforceSignOffInput, skipBodyCheckInput); - if (maybeInputs.error !== null) { - core.error(maybeInputs.error); - core.setFailed(maybeInputs.error); - return; - } - const inputs = maybeInputs.mustInputs(); - //// - // Inspect - //// - // Parts of the error message to be concatenated with '\n' - const parts = []; - for (const [messageIndex, message] of messages.entries()) { - const errors = inspection.check(message, inputs); - if (errors.length > 0) { - const repr = represent.formatErrors(message, messageIndex, errors); - parts.push(repr); - } - else { - core.info(`The message is OK:\n---\n${message}\n---`); - } - } - const errorMessage = parts.join('\n'); - if (errorMessage.length > 0) { - core.setFailed(errorMessage); - } -} -/** - * Main function - */ -function run() { - try { - runWithExceptions(); - } - catch (error) { - core.error(error); - core.setFailed(error.message); - } -} -exports.run = run; + +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.run = void 0; +const core = __importStar(__webpack_require__(470)); +const commitMessages = __importStar(__webpack_require__(281)); +const inspection = __importStar(__webpack_require__(117)); +const represent = __importStar(__webpack_require__(110)); +const input = __importStar(__webpack_require__(265)); +function runWithExceptions() { + var _a, _b, _c, _d, _e, _f, _g; + const messages = commitMessages.retrieve(); + //// + // Parse inputs + //// + const additionalVerbsInput = (_a = core.getInput('additional-verbs', { required: false })) !== null && _a !== void 0 ? _a : ''; + const pathToAdditionalVerbsInput = (_b = core.getInput('path-to-additional-verbs', { required: false })) !== null && _b !== void 0 ? _b : ''; + const allowOneLinersInput = (_c = core.getInput('allow-one-liners', { required: false })) !== null && _c !== void 0 ? _c : ''; + const maxSubjectLengthInput = (_d = core.getInput('max-subject-line-length', { required: false })) !== null && _d !== void 0 ? _d : ''; + const maxBodyLineLengthInput = (_e = core.getInput('max-body-line-length', { required: false })) !== null && _e !== void 0 ? _e : ''; + const enforceSignOffInput = (_f = core.getInput('enforce-sign-off', { required: false })) !== null && _f !== void 0 ? _f : ''; + const skipBodyCheckInput = (_g = core.getInput('skip-body-check', { required: false })) !== null && _g !== void 0 ? _g : ''; + const maybeInputs = input.parseInputs(additionalVerbsInput, pathToAdditionalVerbsInput, allowOneLinersInput, maxSubjectLengthInput, maxBodyLineLengthInput, enforceSignOffInput, skipBodyCheckInput); + if (maybeInputs.error !== null) { + core.error(maybeInputs.error); + core.setFailed(maybeInputs.error); + return; + } + const inputs = maybeInputs.mustInputs(); + //// + // Inspect + //// + // Parts of the error message to be concatenated with '\n' + const parts = []; + for (const [messageIndex, message] of messages.entries()) { + const errors = inspection.check(message, inputs); + if (errors.length > 0) { + const repr = represent.formatErrors(message, messageIndex, errors); + parts.push(repr); + } + else { + core.info(`The message is OK:\n---\n${message}\n---`); + } + } + const errorMessage = parts.join('\n'); + if (errorMessage.length > 0) { + core.setFailed(errorMessage); + } +} +/** + * Main function + */ +function run() { + try { + runWithExceptions(); + } + catch (error) { + core.error(error); + core.setFailed(error.message); + } +} +exports.run = run; /***/ }), @@ -6381,785 +6381,787 @@ module.exports.Collection = Hook.Collection /***/ (function(__unusedmodule, exports) { "use strict"; - -Object.defineProperty(exports, "__esModule", { value: true }); -exports.SET = void 0; -exports.SET = new Set([ - 'abandon', - 'accept', - 'accompany', - 'account', - 'accuse', - 'ache', - 'achieve', - 'acknowledge', - 'acquire', - 'act', - 'active', - 'add', - 'address', - 'adhere', - 'adjust', - 'admit', - 'adopt', - 'advise', - 'advocate', - 'affect', - 'affirm', - 'afford', - 'agree', - 'aim', - 'allow', - 'alter', - 'analyse', - 'analyze', - 'announce', - 'annoy', - 'annul', - 'answer', - 'appeal', - 'appear', - 'applicate', - 'apply', - 'appoint', - 'appreciate', - 'approach', - 'approve', - 'argue', - 'arise', - 'arrange', - 'arrest', - 'arrive', - 'ask', - 'assert', - 'assess', - 'assist', - 'associate', - 'assume', - 'assure', - 'attach', - 'attack', - 'attempt', - 'attend', - 'attract', - 'avoid', - 'awake', - 'back', - 'backup', - 'bake', - 'base', - 'battle', - 'be', - 'bear', - 'beat', - 'become', - 'begin', - 'behave', - 'believe', - 'belong', - 'bend', - 'benefit', - 'better', - 'beware', - 'bind', - 'blame', - 'blend', - 'blow', - 'born', - 'bother', - 'break', - 'bring', - 'build', - 'bump', - 'burn', - 'busy', - 'buy', - 'calculate', - 'call', - 'capture', - 'care', - 'carry', - 'carryout', - 'cast', - 'catch', - 'cause', - 'challenge', - 'change', - 'chant', - 'charge', - 'chase', - 'chat', - 'check', - 'choose', - 'circle', - 'claim', - 'clean', - 'cleanse', - 'clear', - 'climb', - 'close', - 'clothe', - 'collapse', - 'collect', - 'combine', - 'come', - 'command', - 'comment', - 'commit', - 'compare', - 'compensate', - 'compile', - 'complain', - 'complete', - 'compose', - 'compress', - 'conceal', - 'concentrate', - 'conclude', - 'concur', - 'conduct', - 'confirm', - 'confront', - 'connect', - 'connote', - 'consider', - 'consist', - 'constitute', - 'construct', - 'consume', - 'contact', - 'contain', - 'contest', - 'continue', - 'contribute', - 'control', - 'convert', - 'convey', - 'cook', - 'cope', - 'cost', - 'counsel', - 'count', - 'cover', - 'create', - 'cross', - 'cry', - 'cut', - 'damage', - 'dance', - 'deal', - 'debate', - 'decide', - 'declare', - 'defeat', - 'defend', - 'define', - 'delay', - 'deliver', - 'demand', - 'demolish', - 'demonstrate', - 'deny', - 'depart', - 'depend', - 'depict', - 'derive', - 'describe', - 'design', - 'desire', - 'destroy', - 'detail', - 'detect', - 'determine', - 'develop', - 'devote', - 'die', - 'direct', - 'disappear', - 'discontinue', - 'discourage', - 'discover', - 'discuss', - 'dislike', - 'dismiss', - 'displace', - 'display', - 'distinguish', - 'divide', - 'do', - 'dominate', - 'draw', - 'dread', - 'dress', - 'drink', - 'drive', - 'drop', - 'earn', - 'eat', - 'educate', - 'elect', - 'elevate', - 'emerge', - 'employ', - 'enable', - 'encourage', - 'end', - 'endorse', - 'endure', - 'enforce', - 'engage', - 'enjoy', - 'enquire', - 'enroll', - 'ensure', - 'enter', - 'equal', - 'equate', - 'escape', - 'establish', - 'estimate', - 'evaluate', - 'examine', - 'except', - 'exclude', - 'excuse', - 'execute', - 'exercise', - 'exert', - 'exist', - 'expand', - 'expect', - 'experience', - 'explain', - 'explore', - 'express', - 'extend', - 'face', - 'fail', - 'fall', - 'fault', - 'fear', - 'feature', - 'feed', - 'feel', - 'fight', - 'fill', - 'find', - 'finish', - 'fit', - 'fix', - 'flee', - 'float', - 'flunk', - 'fly', - 'focus', - 'follow', - 'force', - 'foresee', - 'forget', - 'form', - 'forward', - 'found', - 'free', - 'gain', - 'gather', - 'generate', - 'get', - 'give', - 'giveup', - 'glance', - 'go', - 'going', - 'govern', - 'grant', - 'grin', - 'grow', - 'guess', - 'guide', - 'hand', - 'handle', - 'hang', - 'happen', - 'harm', - 'hate', - 'have', - 'head', - 'hear', - 'help', - 'hide', - 'hire', - 'hit', - 'hold', - 'hope', - 'house', - 'hurt', - 'identify', - 'ignore', - 'illuminate', - 'illustrate', - 'imagine', - 'implement', - 'imply', - 'importune', - 'impose', - 'improve', - 'include', - 'incorporate', - 'increase', - 'incur', - 'indicate', - 'influence', - 'inform', - 'initiate', - 'injure', - 'insist', - 'intend', - 'interpret', - 'introduce', - 'invest', - 'investigate', - 'invite', - 'involve', - 'issue', - 'join', - 'journey', - 'joy', - 'judge', - 'jump', - 'justify', - 'keep', - 'key', - 'kick', - 'kill', - 'kiss', - 'knock', - 'know', - 'label', - 'lack', - 'land', - 'last', - 'laugh', - 'launch', - 'lay', - 'lead', - 'lean', - 'leap', - 'learn', - 'leave', - 'let', - 'lie', - 'lift', - 'light', - 'like', - 'limit', - 'link', - 'list', - 'listen', - 'live', - 'locate', - 'lock', - 'look', - 'lose', - 'love', - 'maintain', - 'make', - 'manage', - 'mark', - 'marry', - 'match', - 'matter', - 'mean', - 'measure', - 'meet', - 'menace', - 'mention', - 'mind', - 'misinform', - 'miss', - 'mix', - 'move', - 'name', - 'near', - 'need', - 'nod', - 'note', - 'notice', - 'observe', - 'obtain', - 'occupy', - 'occur', - 'offer', - 'officiate', - 'omit', - 'open', - 'operate', - 'order', - 'organise', - 'organize', - 'owe', - 'own', - 'paint', - 'partake', - 'pass', - 'pay', - 'perform', - 'permit', - 'persuade', - 'pick', - 'place', - 'plan', - 'play', - 'plow', - 'point', - 'ponder', - 'possess', - 'pour', - 'predict', - 'prefer', - 'prepare', - 'present', - 'preserve', - 'press', - 'presume', - 'prevent', - 'print', - 'proceed', - 'process', - 'procure', - 'produce', - 'promise', - 'promote', - 'propose', - 'prosecute', - 'protect', - 'protest', - 'prove', - 'provide', - 'publish', - 'pull', - 'purchase', - 'pursue', - 'push', - 'put', - 'puton', - 'question', - 'quote', - 'race', - 'raise', - 'reach', - 'read', - 'realise', - 'realize', - 'reason', - 'recall', - 'receive', - 'reckon', - 'recognise', - 'recognize', - 'recommend', - 'record', - 'recover', - 'recur', - 'reduce', - 'refer', - 'reference', - 'reflect', - 'refuse', - 'regard', - 'register', - 'reject', - 'relate', - 'release', - 'rely', - 'remain', - 'remember', - 'remind', - 'remove', - 'repair', - 'repeat', - 'repel', - 'replace', - 'reply', - 'report', - 'represent', - 'request', - 'require', - 'research', - 'reside', - 'resolve', - 'respond', - 'rest', - 'restore', - 'restrict', - 'result', - 'retain', - 'retire', - 'retreat', - 'return', - 'reveal', - 'review', - 'ride', - 'ring', - 'rise', - 'roll', - 'rule', - 'run', - 'sale', - 'salute', - 'save', - 'say', - 'score', - 'search', - 'secure', - 'see', - 'seek', - 'seem', - 'select', - 'sell', - 'send', - 'separate', - 'serve', - 'set', - 'settle', - 'shake', - 'shape', - 'share', - 'shift', - 'shoot', - 'shout', - 'show', - 'shut', - 'sign', - 'signify', - 'sing', - 'sit', - 'sleep', - 'slide', - 'slip', - 'smile', - 'solve', - 'sort', - 'sound', - 'speak', - 'specify', - 'spend', - 'split', - 'spread', - 'stand', - 'stare', - 'start', - 'state', - 'stay', - 'steal', - 'steer', - 'step', - 'stick', - 'stop', - 'stress', - 'stretch', - 'strike', - 'struggle', - 'study', - 'submit', - 'succeed', - 'suffer', - 'suggest', - 'suit', - 'supply', - 'support', - 'suppose', - 'surround', - 'survive', - 'suspect', - 'sway', - 'switch', - 'take', - 'talk', - 'talkover', - 'target', - 'teach', - 'tell', - 'tempt', - 'tend', - 'terminate', - 'test', - 'testify', - 'thank', - 'think', - 'threaten', - 'throw', - 'tie', - 'touch', - 'track', - 'trade', - 'train', - 'transfer', - 'travel', - 'tread', - 'treat', - 'trim', - 'trust', - 'try', - 'turn', - 'twist', - 'uncover', - 'understand', - 'undertake', - 'unfold', - 'unite', - 'unload', - 'urge', - 'use', - 'utter', - 'value', - 'vanish', - 'vary', - 'view', - 'visit', - 'vocalize', - 'voice', - 'vote', - 'wait', - 'wake', - 'walk', - 'want', - 'warn', - 'warrant', - 'wash', - 'watch', - 'wear', - 'weep', - 'weigh', - 'welcome', - 'win', - 'wish', - 'withdraw', - 'wonder', - 'work', - 'workout', - 'worry', - 'write', - // Verbs specific to programming - 'rewrite', - 'refactor', - 'reorganise', - 'reorganize', - 'restructure', - 'unify', - 'reword', - 'rephrase', - 'upgrade', - 'reformat', - 'update', - 'rename', - 'revert', - 'correct', - 'invalidate', - 'whitelist', - 'blacklist', - 'merge', - 'disable', - 'document', - 'simplify', - 'extract', - 'downgrade', - 'clarify', - 'relax', - 'wrap', - 'unwrap', - 'rewrap', - 're-wrap', - 'delete', - 'erase', - 'sync', - 'synchronize', - 'synchronise', - 'gitignore', - 'initialize', - 'translate', - 'intercept', - 'format', - 'override', - 're-define', - 'redefine', - 'unskip', - 'self-initialize', - 'echo', - 'pack', - 'package', - 'unpack', - 'deconstruct', - 'materialize', - 'align', - 'edit', - 'cache', - 'undo', - 'refresh', - 'flatten', - 'map', - 'qualify', - 'internalize', - 'privatize', - 'mutate', - 'reorder', - 'enumerate', - 'sample', - 'randomize', - 'categorize', - 'assign', - 'standardize', - 'in-line', - 'inline', - 'redo', - 're-do', - 'consolidate', - 'install', - 'configure', - 're-instate', - 'reinstate', - 'pin', - 'hint', - 'integrate', - 'instruct', - 'verbosify', - 'log', - 'enhance', - 'untrack', - 'refine', - 'dispatch', - 'export', - 'import', - 'skip', - 'redirect', - 'duplicate', - 'deduplicate', - 'de-duplicate', - 're-order', - 'undry', - 'suppress', - 're-enable', - 'guard', - 'revise', - 'revisit', - 'fork', - 'isolate', - 're-design', - 'redesign', - 'tweak', - 'tune', - 'reset', - 're-set', - 'scale', - 're-scale', - 'rescale', - 'dry', - 'augment', - 'favor', - 'optimize', - 'optimise', - 'default', - 'patch' -]); + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.SET = void 0; +exports.SET = new Set([ + 'abandon', + 'accept', + 'accompany', + 'account', + 'accuse', + 'ache', + 'achieve', + 'acknowledge', + 'acquire', + 'act', + 'active', + 'add', + 'address', + 'adhere', + 'adjust', + 'admit', + 'adopt', + 'advise', + 'advocate', + 'affect', + 'affirm', + 'afford', + 'agree', + 'aim', + 'allow', + 'alter', + 'analyse', + 'analyze', + 'announce', + 'annoy', + 'annul', + 'answer', + 'appeal', + 'appear', + 'applicate', + 'apply', + 'appoint', + 'appreciate', + 'approach', + 'approve', + 'argue', + 'arise', + 'arrange', + 'arrest', + 'arrive', + 'ask', + 'assert', + 'assess', + 'assist', + 'associate', + 'assume', + 'assure', + 'attach', + 'attack', + 'attempt', + 'attend', + 'attract', + 'avoid', + 'awake', + 'back', + 'backup', + 'bake', + 'base', + 'battle', + 'be', + 'bear', + 'beat', + 'become', + 'begin', + 'behave', + 'believe', + 'belong', + 'bend', + 'benefit', + 'better', + 'beware', + 'bind', + 'blame', + 'blend', + 'blow', + 'born', + 'bother', + 'break', + 'bring', + 'build', + 'bump', + 'burn', + 'busy', + 'buy', + 'calculate', + 'call', + 'capture', + 'care', + 'carry', + 'carryout', + 'cast', + 'catch', + 'cause', + 'challenge', + 'change', + 'chant', + 'charge', + 'chase', + 'chat', + 'check', + 'choose', + 'circle', + 'claim', + 'clean', + 'cleanse', + 'clear', + 'climb', + 'close', + 'clothe', + 'collapse', + 'collect', + 'combine', + 'come', + 'command', + 'comment', + 'commit', + 'compare', + 'compensate', + 'compile', + 'complain', + 'complete', + 'compose', + 'compress', + 'conceal', + 'concentrate', + 'conclude', + 'concur', + 'conduct', + 'confirm', + 'confront', + 'connect', + 'connote', + 'consider', + 'consist', + 'constitute', + 'construct', + 'consume', + 'contact', + 'contain', + 'contest', + 'continue', + 'contribute', + 'control', + 'convert', + 'convey', + 'cook', + 'cope', + 'cost', + 'counsel', + 'count', + 'cover', + 'create', + 'cross', + 'cry', + 'cut', + 'damage', + 'dance', + 'deal', + 'debate', + 'decide', + 'declare', + 'defeat', + 'defend', + 'define', + 'delay', + 'deliver', + 'demand', + 'demolish', + 'demonstrate', + 'deny', + 'depart', + 'depend', + 'depict', + 'derive', + 'describe', + 'design', + 'desire', + 'destroy', + 'detail', + 'detect', + 'determine', + 'develop', + 'devote', + 'die', + 'direct', + 'disappear', + 'discontinue', + 'discourage', + 'discover', + 'discuss', + 'dislike', + 'dismiss', + 'displace', + 'display', + 'distinguish', + 'divide', + 'do', + 'dominate', + 'draw', + 'dread', + 'dress', + 'drink', + 'drive', + 'drop', + 'earn', + 'eat', + 'educate', + 'elect', + 'elevate', + 'emerge', + 'employ', + 'enable', + 'encourage', + 'end', + 'endorse', + 'endure', + 'enforce', + 'engage', + 'enjoy', + 'enquire', + 'enroll', + 'ensure', + 'enter', + 'equal', + 'equate', + 'escape', + 'establish', + 'estimate', + 'evaluate', + 'examine', + 'except', + 'exclude', + 'excuse', + 'execute', + 'exercise', + 'exert', + 'exist', + 'expand', + 'expect', + 'experience', + 'explain', + 'explore', + 'expose', + 'express', + 'extend', + 'face', + 'fail', + 'fall', + 'fault', + 'fear', + 'feature', + 'feed', + 'feel', + 'fight', + 'fill', + 'find', + 'finish', + 'fit', + 'fix', + 'flee', + 'float', + 'flunk', + 'fly', + 'focus', + 'follow', + 'force', + 'foresee', + 'forget', + 'form', + 'forward', + 'found', + 'free', + 'gain', + 'gather', + 'generate', + 'get', + 'give', + 'giveup', + 'glance', + 'go', + 'going', + 'govern', + 'grant', + 'grin', + 'grow', + 'guess', + 'guide', + 'hand', + 'handle', + 'hang', + 'happen', + 'harm', + 'hate', + 'have', + 'head', + 'hear', + 'help', + 'hide', + 'hire', + 'hit', + 'hold', + 'hope', + 'house', + 'hurt', + 'identify', + 'ignore', + 'illuminate', + 'illustrate', + 'imagine', + 'implement', + 'imply', + 'importune', + 'impose', + 'improve', + 'include', + 'incorporate', + 'increase', + 'incur', + 'indicate', + 'influence', + 'inform', + 'initiate', + 'injure', + 'insist', + 'intend', + 'interpret', + 'introduce', + 'invest', + 'investigate', + 'invite', + 'involve', + 'issue', + 'join', + 'journey', + 'joy', + 'judge', + 'jump', + 'justify', + 'keep', + 'key', + 'kick', + 'kill', + 'kiss', + 'knock', + 'know', + 'label', + 'lack', + 'land', + 'last', + 'laugh', + 'launch', + 'lay', + 'lead', + 'lean', + 'leap', + 'learn', + 'leave', + 'let', + 'lie', + 'lift', + 'light', + 'like', + 'limit', + 'link', + 'list', + 'listen', + 'live', + 'locate', + 'lock', + 'look', + 'lose', + 'love', + 'maintain', + 'make', + 'manage', + 'mark', + 'marry', + 'match', + 'matter', + 'mean', + 'measure', + 'meet', + 'menace', + 'mention', + 'mind', + 'misinform', + 'miss', + 'mix', + 'move', + 'name', + 'near', + 'need', + 'nod', + 'note', + 'notice', + 'observe', + 'obtain', + 'occupy', + 'occur', + 'offer', + 'officiate', + 'omit', + 'open', + 'operate', + 'order', + 'organise', + 'organize', + 'owe', + 'own', + 'paint', + 'partake', + 'pass', + 'pay', + 'perform', + 'permit', + 'persuade', + 'pick', + 'place', + 'plan', + 'play', + 'plow', + 'point', + 'ponder', + 'possess', + 'pour', + 'predict', + 'prefer', + 'prepare', + 'present', + 'preserve', + 'press', + 'presume', + 'prevent', + 'print', + 'proceed', + 'process', + 'procure', + 'produce', + 'promise', + 'promote', + 'propose', + 'prosecute', + 'protect', + 'protest', + 'prove', + 'provide', + 'publish', + 'pull', + 'purchase', + 'pursue', + 'push', + 'put', + 'puton', + 'question', + 'quote', + 'race', + 'raise', + 'reach', + 'read', + 'realise', + 'realize', + 'reason', + 'recall', + 'receive', + 'reckon', + 'recognise', + 'recognize', + 'recommend', + 'record', + 'recover', + 'recur', + 'reduce', + 'refer', + 'reference', + 'reflect', + 'refuse', + 'regard', + 'register', + 'reject', + 'relate', + 'release', + 'rely', + 'remain', + 'remember', + 'remind', + 'remove', + 'repair', + 'repeat', + 'repel', + 'replace', + 'reply', + 'report', + 'represent', + 'request', + 'require', + 'research', + 'reside', + 'resolve', + 'respond', + 'rest', + 'restore', + 'restrict', + 'result', + 'retain', + 'retire', + 'retreat', + 'return', + 'reveal', + 'review', + 'ride', + 'ring', + 'rise', + 'roll', + 'rule', + 'run', + 'sale', + 'salute', + 'save', + 'say', + 'score', + 'search', + 'secure', + 'see', + 'seek', + 'seem', + 'select', + 'sell', + 'send', + 'separate', + 'serve', + 'set', + 'settle', + 'shake', + 'shape', + 'share', + 'shift', + 'shoot', + 'shout', + 'show', + 'shut', + 'sign', + 'signify', + 'sing', + 'sit', + 'sleep', + 'slide', + 'slip', + 'smile', + 'solve', + 'sort', + 'sound', + 'speak', + 'specify', + 'spend', + 'split', + 'spread', + 'stand', + 'stare', + 'start', + 'state', + 'stay', + 'steal', + 'steer', + 'step', + 'stick', + 'stop', + 'stress', + 'stretch', + 'strike', + 'struggle', + 'study', + 'submit', + 'succeed', + 'suffer', + 'suggest', + 'suit', + 'supply', + 'support', + 'suppose', + 'surround', + 'survive', + 'suspect', + 'sway', + 'switch', + 'take', + 'talk', + 'talkover', + 'target', + 'teach', + 'tell', + 'tempt', + 'tend', + 'terminate', + 'test', + 'testify', + 'thank', + 'think', + 'threaten', + 'throw', + 'tie', + 'touch', + 'track', + 'trade', + 'train', + 'transfer', + 'travel', + 'tread', + 'treat', + 'trim', + 'trust', + 'try', + 'turn', + 'twist', + 'uncover', + 'understand', + 'undertake', + 'unfold', + 'unite', + 'unload', + 'urge', + 'use', + 'utter', + 'value', + 'vanish', + 'vary', + 'view', + 'visit', + 'vocalize', + 'voice', + 'vote', + 'wait', + 'wake', + 'walk', + 'want', + 'warn', + 'warrant', + 'wash', + 'watch', + 'wear', + 'weep', + 'weigh', + 'welcome', + 'win', + 'wish', + 'withdraw', + 'wonder', + 'work', + 'workout', + 'worry', + 'write', + // Verbs specific to programming + 'rewrite', + 'refactor', + 'reorganise', + 'reorganize', + 'restructure', + 'unify', + 'reword', + 'rephrase', + 'upgrade', + 'reformat', + 'update', + 'rename', + 'revert', + 'correct', + 'invalidate', + 'whitelist', + 'blacklist', + 'merge', + 'disable', + 'document', + 'simplify', + 'extract', + 'downgrade', + 'clarify', + 'relax', + 'wrap', + 'unwrap', + 'rewrap', + 're-wrap', + 'delete', + 'erase', + 'sync', + 'synchronize', + 'synchronise', + 'gitignore', + 'initialize', + 'translate', + 'intercept', + 'format', + 'override', + 're-define', + 'redefine', + 'unskip', + 'self-initialize', + 'echo', + 'pack', + 'package', + 'unpack', + 'deconstruct', + 'materialize', + 'align', + 'edit', + 'cache', + 'undo', + 'refresh', + 'flatten', + 'map', + 'qualify', + 'internalize', + 'privatize', + 'mutate', + 'reorder', + 'enumerate', + 'sample', + 'randomize', + 'categorize', + 'assign', + 'standardize', + 'in-line', + 'inline', + 'redo', + 're-do', + 'consolidate', + 'install', + 'configure', + 're-instate', + 'reinstate', + 'pin', + 'hint', + 'integrate', + 'instruct', + 'verbosify', + 'log', + 'enhance', + 'untrack', + 'refine', + 'dispatch', + 'export', + 'import', + 'skip', + 'redirect', + 'duplicate', + 'deduplicate', + 'de-duplicate', + 're-order', + 'undry', + 'suppress', + 're-enable', + 'guard', + 'revise', + 'revisit', + 'fork', + 'isolate', + 're-design', + 'redesign', + 'tweak', + 'tune', + 'reset', + 're-set', + 'scale', + 're-scale', + 'rescale', + 'dry', + 'augment', + 'favor', + 'optimize', + 'optimise', + 'default', + 'patch', + 'group' +]); /***/ }), diff --git a/src/mostFrequentEnglishVerbs.ts b/src/mostFrequentEnglishVerbs.ts index 560bd4c..f41bc25 100644 --- a/src/mostFrequentEnglishVerbs.ts +++ b/src/mostFrequentEnglishVerbs.ts @@ -774,5 +774,6 @@ export const SET = new Set([ 'optimize', 'optimise', 'default', - 'patch' + 'patch', + 'group' ]);