Skip to content

Commit

Permalink
Merge pull request #37 from SonicGarden/dev
Browse files Browse the repository at this point in the history
Limit the number of rows in examples table
  • Loading branch information
aki77 authored Jul 9, 2024
2 parents 4325894 + 3dc294b commit dd93155
Show file tree
Hide file tree
Showing 7 changed files with 211 additions and 179 deletions.
14 changes: 12 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39267,14 +39267,24 @@ exports.examples2Table = examples2Table;
const core = __importStar(__nccwpck_require__(9093));
const github = __importStar(__nccwpck_require__(5942));
const actions_replace_comment_1 = __importStar(__nccwpck_require__(5518));
const MAX_TABLE_ROWS = 20;
const MAX_MESSAGE_LENGTH = 200;
const truncate = (str, maxLength) => {
return str.length > maxLength ? `${str.slice(0, maxLength)}...` : str;
};
async function examples2Table(examples) {
const { markdownTable } = await __nccwpck_require__.e(/* import() */ 448).then(__nccwpck_require__.bind(__nccwpck_require__, 6850));
return markdownTable([
['Example', 'Description', 'Message'],
...examples.map(({ filePath, lineNumber, description, message }) => [
...examples
.slice(0, MAX_TABLE_ROWS)
.map(({ filePath, lineNumber, description, message }) => [
[filePath, lineNumber].join(':'),
description,
message.replace(/\\n/g, ' ').trim().replace(/\s+/g, ' ')
truncate(message, MAX_MESSAGE_LENGTH)
.replace(/\\n/g, ' ')
.trim()
.replace(/\s+/g, ' ')
])
]);
}
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

14 changes: 12 additions & 2 deletions dist/report-comment.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/report-comment.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rspec-report-action",
"version": "5.0.0",
"version": "5.1.0",
"private": true,
"description": "TypeScript template action",
"main": "lib/main.js",
Expand Down Expand Up @@ -28,32 +28,32 @@
"author": "aki77",
"license": "MIT",
"dependencies": {
"@actions/core": "^1.9.1",
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@aki77/actions-replace-comment": "^0.6.1",
"fast-glob": "^3.2.12",
"@aki77/actions-replace-comment": "0.6.1",
"fast-glob": "^3.3.2",
"markdown-table": "^3.0.3"
},
"devDependencies": {
"@babel/plugin-transform-modules-commonjs": "^7.15.0",
"@babel/preset-env": "^7.15.0",
"@babel/plugin-transform-modules-commonjs": "^7.24.7",
"@babel/preset-env": "^7.24.7",
"@jest/globals": "^29.7.0",
"@types/jest": "^29.5.1",
"@types/node": "^20.8.8",
"@typescript-eslint/eslint-plugin": "^7.14.1",
"@typescript-eslint/parser": "^7.14.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.14.10",
"@typescript-eslint/eslint-plugin": "^7.15.0",
"@typescript-eslint/parser": "^7.15.0",
"@vercel/ncc": "^0.38.1",
"babel-jest": "^29.5.0",
"eslint": "^8.15.0",
"babel-jest": "^29.7.0",
"eslint": "^8.57.0",
"eslint-plugin-github": "^5.0.1",
"eslint-plugin-jest": "^28.6.0",
"eslint-plugin-prettier": "^5.0.1",
"jest": "^29.5.0",
"jest-circus": "^29.5.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"jest-circus": "^29.7.0",
"js-yaml": "^4.1.0",
"prettier": "3.3.2",
"ts-jest": "^29.1.0",
"typescript": "^5.0.4"
"ts-jest": "^29.1.5",
"typescript": "^5.5.3"
},
"volta": {
"node": "20.15.0",
Expand Down
Loading

0 comments on commit dd93155

Please sign in to comment.