Pre-commit lint staged only, add yarn test:coverage:file#1172
Pre-commit lint staged only, add yarn test:coverage:file#1172RembrandtK wants to merge 2 commits into
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Avoid potential issues with shell globbing as per CoPilot suggestion. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
[nitpick] Consider adding cleanup of the 'addresses-local.json' file after test execution to avoid leaving residual files or accidental commits.
There was a problem hiding this comment.
@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.
There was a problem hiding this comment.
it should be safe to remove after the tests run. But it's been a while since I looked at this branch so there might be something I'm not remembering, if you find an issue with removing it then let's leave it 🫤
|
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. |
|
Okay, seems actually this is aligned with the direction taken in prettier, it is eslint we are not using it for. |
|
This is now obsolete as modernise PR covered greater scope. |
No description provided.