Skip to content

Commit 0ab1282

Browse files
authored
Documentation Cleanup & Improvements for 0.8.7 release (#859)
1 parent 44a999f commit 0ab1282

File tree

5 files changed

+85
-196
lines changed

5 files changed

+85
-196
lines changed

HARDHAT_README.md

Lines changed: 0 additions & 133 deletions
This file was deleted.

README.md

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Or, if you are using TypeScript, add this to your hardhat.config.ts:
3232
```ts
3333
import 'solidity-coverage'
3434
```
35+
3536
**Resources**:
3637
+ [0.8.0 release notes][31]
3738

@@ -40,13 +41,32 @@ import 'solidity-coverage'
4041
npx hardhat coverage [command-options]
4142
```
4243

44+
### Trouble shooting
45+
46+
**Missing or unexpected coverage?** Make sure you're using the latest plugin version and run:
47+
```sh
48+
$ npx hardhat clean
49+
$ npx hardhat compile
50+
$ npx hardhat coverage
51+
```
52+
53+
**Typescript compilation errors?**
54+
```sh
55+
$ npx hardhat compile
56+
$ TS_NODE_TRANSPILE_ONLY=true npx hardhat coverage
57+
```
58+
59+
**Additional Help**
60+
+ [FAQ][1007]
61+
+ [Advanced Topics][1005]
62+
63+
4364
## Command Options
4465
| Option <img width=200/> | Example <img width=750/>| Description <img width=1000/> |
4566
|--------------|------------------------------------|--------------------------------|
4667
| testfiles | `--testfiles "test/registry/*.ts"` | Test file(s) to run. (Globs must be enclosed by quotes and use [globby matching patterns][38])|
4768
| sources | `--sources myFolder` or `--sources myFile.sol` | Path to *single* folder or file to target for coverage. Path is relative to Hardhat's `paths.sources` (usually `contracts/`) |
4869
| solcoverjs | `--solcoverjs ./../.solcover.js` | Relative path from working directory to config. Useful for monorepo packages that share settings. (Path must be "./" prefixed) |
49-
| temp[<sup>*</sup>][14] | `--temp build` | :warning: **Caution** :warning: Path to a *disposable* folder to store compilation artifacts in. Useful when your test setup scripts include hard-coded paths to a build directory. [More...][14] |
5070
| matrix | `--matrix` | Generate a JSON object that maps which mocha tests hit which lines of code. (Useful as an input for some fuzzing, mutation testing and fault-localization algorithms.) [More...][39]|
5171

5272
[<sup>*</sup> Advanced use][14]
@@ -63,10 +83,10 @@ module.exports = {
6383
};
6484
```
6585

66-
| Option <img width=200/>| Type <img width=200/> | Default <img width=1300/> | Description <img width=800/> |
86+
| Option <img width=200/>| Type <img width=200/> | Default <img width=1000/> | Description <img width=1000/> |
6787
| ------ | ---- | ------- | ----------- |
6888
| silent | *Boolean* | false | Suppress logging output |
69-
| skipFiles | *Array* | `['Migrations.sol']` | Array of contracts or folders (with paths expressed relative to the `contracts` directory) that should be skipped when doing instrumentation. |
89+
| skipFiles | *Array* | `[]` | Array of contracts or folders (with paths expressed relative to the `contracts` directory) that should be skipped when doing instrumentation.(Example: `[ "Routers", "Networks/Polygon.sol"]` :bulb: **RUN THE HARDHAT CLEAN COMMAND AFTER UPDATING THIS** ) |
7090
| measureStatementCoverage | *boolean* | `true` | Computes statement (in addition to line) coverage. [More...][34] |
7191
| measureFunctionCoverage | *boolean* | `true` | Computes function coverage. [More...][34] |
7292
| measureModifierCoverage | *boolean* | `true` | Computes each modifier invocation as a code branch. [More...][34] |
@@ -79,12 +99,12 @@ module.exports = {
7999
| mocha | *Object* | `{ }` | [Mocha options][3] to merge into existing mocha config. `grep` and `invert` are useful for skipping certain tests under coverage using tags in the test descriptions.|
80100
| coverageContractsTemp | *String* | `.coverage_contracts` | Temporary folder location for instrumented contracts - Note that this directory will automatically be deleted when coverage completes. |
81101
| onServerReady[<sup>*</sup>][14] | *Function* | | Hook run *after* server is launched, *before* the tests execute. Useful if you need to use the Oraclize bridge or have setup scripts which rely on the server's availability. [More...][23] |
82-
| onPreCompile[<sup>*</sup>][14] | *Function* | | Hook run *after* filesystem and compiler configuration is applied, *before* the compiler is run. Can be used with the other hooks to be able to generate coverage reports on non-standard / customized directory structures, as well as contracts with absolute import paths. [More...][23] |
102+
| onPreCompile[<sup>*</sup>][14] | *Function* | | Hook run *after* instrumentation is performed, *before* the compiler is run. Can be used with the other hooks to be able to generate coverage reports on non-standard / customized directory structures, as well as contracts with absolute import paths. [More...][23] |
83103
| onCompileComplete[<sup>*</sup>][14] | *Function* | | Hook run *after* compilation completes, *before* tests are run. Useful if you have secondary compilation steps or need to modify built artifacts. [More...][23]|
84104
| onTestsComplete[<sup>*</sup>][14] | *Function* | | Hook run *after* the tests complete, *before* Istanbul reports are generated. [More...][23]|
85105
| onIstanbulComplete[<sup>*</sup>][14] | *Function* | | Hook run *after* the Istanbul reports are generated, *before* the coverage task completes. Useful if you need to clean resources up. [More...][23]|
86-
| configureYulOptimizer | *Boolean* | false | (Experimental) Setting to `true` should resolve "stack too deep" compiler errors in large projects using ABIEncoderV2 |
87-
| solcOptimizerDetails | *Object* | `undefined` |(Experimental) Must be used in combination with `configureYulOptimizer`. Allows you configure solc's [optimizer details][1001]. Useful if the default remedy for stack-too-deep errors doesn't work in your case (See FAQ below). |
106+
| configureYulOptimizer | *Boolean* | false | **(Deprecated since 0.8.7)** Setting to `true` should resolve "stack too deep" compiler errors in large projects using ABIEncoderV2 |
107+
| solcOptimizerDetails | *Object* | `undefined` |**(Deprecated since 0.8.7))** Must be used in combination with `configureYulOptimizer`. Allows you configure solc's [optimizer details][1001]. Useful if the default remedy for stack-too-deep errors doesn't work in your case (See FAQ below). |
88108

89109

90110
[<sup>*</sup> Advanced use][14]
@@ -111,21 +131,12 @@ The coverage plugin sets a boolean variable on the globally injected hardhat env
111131
hre.__SOLIDITY_COVERAGE_RUNNING === true
112132
```
113133

114-
## FAQ
115-
116-
Common problems & questions:
134+
## Example reports
135+
+ [openzeppelin-solidity][10](Codecov)
117136

118-
+ [Running in CI][7]
119-
+ [Running out of gas][13]
120-
+ [Running out of time][6]
121-
+ [Running out of stack][1002] (Stack too deep)
122-
+ [Running out of memory][5]
123-
+ [Running in parallel (in CI)][1003]
124-
+ [Running coverage threshold checks][1004]
137+
## Funding
125138

126-
## Example reports
127-
+ [metacoin][9] (Istanbul HTML)
128-
+ [openzeppelin-solidity][10](Coveralls)
139+
You can help fund solidity-coverage development through [DRIPS][1008]. It's a public goods protocol which helps distribute money to packages in your dependency tree. (It's great, check it out.)
129140

130141
## Contribution Guidelines
131142

@@ -181,4 +192,7 @@ $ yarn
181192
[1002]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md#running-out-of-stack
182193
[1003]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md#parallelization-in-ci
183194
[1004]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md#coverage-threshold-checks
195+
[1005]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/advanced.md
196+
[1007]: https://github.com/sc-forks/solidity-coverage/blob/master/docs/faq.md
197+
[1008]: https://www.drips.network/app/projects/github/sc-forks/solidity-coverage
184198

0 commit comments

Comments
 (0)