Skip to content

Commit

Permalink
Ignore coverage report, increase coverage, adjust CI
Browse files Browse the repository at this point in the history
  • Loading branch information
gretzke committed Oct 16, 2024
1 parent d95322b commit 85607ae
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 109 deletions.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/FEATURE_IMPROVEMENT.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ body:
options:
- Gas Optimization
- General design optimization (improving efficiency, cleanliness, or developer experience)
- Testing
- Documentation
- type: textarea
attributes:
Expand Down
88 changes: 0 additions & 88 deletions .github/workflows/coverage.yaml

This file was deleted.

5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/out
/cache
/coverage
/report
lcov.info
.DS_Store
.env
Expand All @@ -10,7 +11,3 @@ lcov.info

broadcast/*/31337
deployments/**/31337.*

# storage layout checker library
storage_check_cache
storage_check_report
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- [Install](#install)
- [Pre-commit Hooks](#pre-commit-hooks)
- [Requirements for merge](#requirements-for-merge)
- [Branching](#branching)
- [Main](#main)
- [Staging](#staging)
Expand Down Expand Up @@ -38,6 +39,17 @@ This repo includes the following pre-commit hooks that are defined in the `.pre-
- `doc`: This hook uses `forge doc` to automatically generate documentation for all Solidity files whenever the NatSpec documentation changes. The `script/util/doc_gen.sh` script is used to generate documentation. Forge updates the commit hash in the documentation automatically. To only generate new documentation when the documentation has actually changed, the script checks whether more than just the hash has changed in the documentation and discard all changes if only the hash has changed.
- `prettier`: All remaining files are formatted using prettier.

## Requirements for merge

In order for a PR to be merged, it must pass the following requirements:

- All commits within the PR must be signed
- CI must pass (tests, linting, etc.)
- New features must be merged with associated tests
- Bug fixes must have a corresponding test that fails without the fix
- The PR must be approved by at least one maintainer
- The PR must be approved by 2+ maintainers if the PR is a new feature or > 100 LOC changed

## Branching

This section outlines the branching strategy of this repo.
Expand Down
4 changes: 2 additions & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {Counter} from 'src/Counter.sol';
contract Deploy is Script {
using stdJson for string;

function run() public {
function run() public returns (Counter) {
uint256 initialNumber = 5;
new Counter(initialNumber);
return new Counter(initialNumber);
}
}
16 changes: 14 additions & 2 deletions test/Counter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ pragma solidity 0.8.26;

import {GasSnapshot} from 'forge-gas-snapshot/GasSnapshot.sol';
import 'forge-std/Test.sol';
import 'test/util/TestHelpers.sol';

import {Deploy} from 'script/Deploy.s.sol';
import {Counter} from 'src/Counter.sol';

abstract contract Deployed is Test, TestHelpers {
abstract contract Deployed is Test {
Counter counter;

function setUp() public virtual {
Expand Down Expand Up @@ -38,3 +38,15 @@ contract CounterTest_Deployed is Deployed, GasSnapshot {
snapLastCall('Set counter number');
}
}

contract DeploymentTest is Test {
Counter counter;

function setUp() public virtual {
counter = new Deploy().run();
}

function test_IsDeployedCorrectly() public view {
assertEq(counter.number(), 5);
}
}
13 changes: 0 additions & 13 deletions test/util/TestHelpers.sol

This file was deleted.

0 comments on commit 85607ae

Please sign in to comment.