Skip to content

Pre-commit lint staged only, add yarn test:coverage:file #1172

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

RembrandtK
Copy link
Contributor

No description provided.

Copy link

codecov bot commented May 15, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.83%. Comparing base (03d8d2a) to head (ecb5c49).
Report is 18 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1172   +/-   ##
=======================================
  Coverage   92.83%   92.83%           
=======================================
  Files          47       47           
  Lines        2415     2415           
  Branches      438      438           
=======================================
  Hits         2242     2242           
  Misses        173      173           
Flag Coverage Δ
unittests 92.83% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@RembrandtK RembrandtK requested a review from tmigone May 15, 2025 11:25
@RembrandtK RembrandtK self-assigned this May 15, 2025
@RembrandtK RembrandtK requested a review from Copilot May 15, 2025 11:28
Copilot

This comment was marked as outdated.

Avoid potential issues with shell globbing as per CoPilot suggestion.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RembrandtK RembrandtK requested a review from Copilot May 15, 2025 11:40
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a new script to run test coverage on a single test file and updates lint-staged commands for better code formatting.

  • Adds a new bash script (test-coverage-file) that builds contracts, prepares configuration, and runs Hardhat coverage using a provided test file.
  • Updates package.json to include a new test:coverage:file script and adjusts lint-staged commands for Solidity, TypeScript, and JavaScript files.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/contracts/scripts/test-coverage-file New bash script to run coverage for a provided test file.
packages/contracts/package.json Added new test script definition and updated lint-staged commands.
Comments suppressed due to low confidence (1)

packages/contracts/package.json:107

  • [nitpick] Confirm that running both 'prettier' and 'solhint --fix' for Solidity files is necessary, as this may introduce redundancy if one tool fulfills the formatting requirements.
prettier --write

echo "Building contracts before running coverage..."
yarn build

echo "{}" > addresses-local.json
Copy link
Preview

Copilot AI May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding cleanup of the 'addresses-local.json' file after test execution to avoid leaving residual files or accidental commits.

Copilot uses AI. Check for mistakes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tmigone I think leaving the file is a designed feature of how other scripts work, so I am not going to change this unless you suggest I should.

@RembrandtK RembrandtK marked this pull request as draft May 15, 2025 20:33
@RembrandtK
Copy link
Contributor Author

RembrandtK commented May 15, 2025

I realise that although I thought I was using the same tools currently in use for linting, the way I configured it might not conform to eslint-graph-config. I am going to check that first.

@RembrandtK
Copy link
Contributor Author

Okay, seems actually this is aligned with the direction taken in prettier, it is eslint we are not using it for.

@RembrandtK RembrandtK marked this pull request as ready for review May 16, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant