diff --git a/README.md b/README.md index 8ae5080..78be346 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,6 @@ sizeup: color: 5d9801 - name: medium lte: 100 - threshold: true label: name: m color: 7f7203 diff --git a/dist/config/default.yaml b/dist/config/default.yaml index 864ad5a..689affc 100644 --- a/dist/config/default.yaml +++ b/dist/config/default.yaml @@ -48,7 +48,6 @@ sizeup: color: 5d9801 - name: medium lte: 100 - threshold: true label: name: m description: Should be of average difficulty to review diff --git a/dist/default.yaml b/dist/default.yaml index dfceb33..4cb732d 100644 --- a/dist/default.yaml +++ b/dist/default.yaml @@ -13,7 +13,6 @@ categories: color: 5d9801 - name: medium lte: 100 - threshold: true label: name: m description: Should be of average difficulty to review diff --git a/dist/index.js b/dist/index.js index 696283d..5ff6559 100644 --- a/dist/index.js +++ b/dist/index.js @@ -6597,16 +6597,7 @@ class CategoryConfiguration { throw new Error("You can only specify one category without an `lte` value, but we found at least two: " + catchAllCategories.map((c) => c.name)); } - const thresholdCategories = sorted.filter((category) => category.threshold); - if (!thresholdCategories.length) { - throw new Error("You must provide one category with a `threshold` value to act as the warning threshold"); - } - if (thresholdCategories.length > 1) { - throw new Error("You can only specify one category with a `threshold` value, but we found at least two: " + - thresholdCategories.map((c) => c.name)); - } this.categories = sorted; - this.threshold = thresholdCategories[0].lte; } /** * @@ -7097,7 +7088,6 @@ class Score { this.error = error; this.result = undefined; this.category = undefined; - this.threshold = undefined; } /** * Records the result of evaluating the formula. @@ -7109,7 +7099,6 @@ class Score { this.error = undefined; this.result = value; this.category = categories === null || categories === void 0 ? void 0 : categories.categorize(value); - this.threshold = categories === null || categories === void 0 ? void 0 : categories.threshold; } /** * Records that we used a particular value for a variable during evaluation. @@ -7122,10 +7111,7 @@ class Score { } toString({ spacing } = { spacing: 2 }) { return JSON.stringify(this, (key, value) => { - if (key == "category" && value) { - return { name: value.name, lte: value.lte }; - } - else if (value instanceof Map) { + if (value instanceof Map) { return [...value]; } else { diff --git a/package-lock.json b/package-lock.json index 120e894..b0c73d6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@actions/core": "^1.10.1", "@actions/github": "^5.1.1", "@octokit/webhooks": "^12.0.3", - "sizeup-core": "^0.1.4", + "sizeup-core": "^0.2.0", "yaml": "^2.3.2" }, "devDependencies": { @@ -6692,9 +6692,9 @@ "dev": true }, "node_modules/sizeup-core": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/sizeup-core/-/sizeup-core-0.1.4.tgz", - "integrity": "sha512-GCRG+BLwfVj/Z454etFLNCX3mWcmqWBTMQduvWXvFJmtI+XootZicn3L3wuGulBZ7aVE6NeY/7H9ixFMpTahfQ==", + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/sizeup-core/-/sizeup-core-0.2.0.tgz", + "integrity": "sha512-KiyFhkOEG5WLsnQTw2ETaOXYI8I0r7McbEKvLv1DwWjjmC6YZurli+pLI2euROsQ9wjpVJVorUXZcRSILTNzLA==", "dependencies": { "minimatch": "^9.0.3", "parse-diff": "^0.11.1", diff --git a/package.json b/package.json index 25caee8..a3a7bf5 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@actions/core": "^1.10.1", "@actions/github": "^5.1.1", "@octokit/webhooks": "^12.0.3", - "sizeup-core": "^0.1.4", + "sizeup-core": "^0.2.0", "yaml": "^2.3.2" }, "devDependencies": { diff --git a/src/config/default.yaml b/src/config/default.yaml index 864ad5a..689affc 100644 --- a/src/config/default.yaml +++ b/src/config/default.yaml @@ -48,7 +48,6 @@ sizeup: color: 5d9801 - name: medium lte: 100 - threshold: true label: name: m description: Should be of average difficulty to review diff --git a/src/configuration.ts b/src/configuration.ts index e8bbf5f..7551372 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -81,10 +81,6 @@ export interface Configuration1 { * inclusive upper bound on the score that a pull request must have to be assigned this category */ lte?: number - /** - * Whether or not this category marks the threshold above which we should warn about the diff being difficult to review - */ - threshold?: boolean }[] scoring?: { /**