Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(report): update regex pattern to include more separator lines #187

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ exports.computeDiffs = exports.loadReports = exports.variation = void 0;
const orderBy_1 = __importDefault(__nccwpck_require__(94791));
const minimatch_1 = __nccwpck_require__(4501);
const reportHeaderRegex = /^\| .+:.+ contract +\|/gi;
const reportSeparatorRegex = /^[\|╭╰]---/;
const reportSeparatorRegex = /^(?:[\|╭╰+][-=]+|\|[\s|]+$)/;
const variation = (current, previous) => {
const delta = current - previous;
return {
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Minimatch } from "minimatch";
import { DiffReport, GasReport, SortCriterion, SortOrder } from "./types";

const reportHeaderRegex = /^\| .+:.+ contract +\|/gi;
const reportSeparatorRegex = /^[\|╭╰]---/;
const reportSeparatorRegex = /^(?:[\|╭╰+][-=]+|\|[\s|]+$)/;

export const variation = (current: number, previous: number) => {
const delta = current - previous;
Expand Down
4 changes: 3 additions & 1 deletion tests/mocks/gas_report.2.ansi
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,13 @@ Running 17 tests for test-foundry/compound/TestWithdraw.t.sol:TestWithdraw
Test result: ok. 17 passed; 0 failed; finished in 118.90s
╭-----------------------------------------------------------------+-----------------+-------+--------+-------+---------╮
| contracts/compound/IncentivesVault.sol:IncentivesVault Contract | | | | | |
|-----------------------------------------------------------------|-----------------|-------|--------|-------|---------|
+======================================================================================================================+
| Deployment Cost | Deployment Size | | | | |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| 640594 | 3430 | | | | |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| | | | | | |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| Function Name | min | avg | median | max | # calls |
|-----------------------------------------------------------------+-----------------+-------+--------+-------+---------|
| MAX_BASIS_POINTS | 305 | 305 | 305 | 305 | 1 |
Expand Down
Loading