sc-forks / solidity-coverage

Code coverage for Solidity smart-contracts
MIT License
970 stars 261 forks source link

Feature request: override default cwd path for `.solcover.js` #384

Closed PaulRBerg closed 4 years ago

PaulRBerg commented 5 years ago

My folder structure:

I have to do this because solidity-coverage uses req-cwd. It'd be cooler if I could override the default cwd path for .solcover.js through the CLI. It seems that solidity-coverage doesn't accept any options at all at the moment.

cgewecke commented 5 years ago

@PaulRBerg Ah yes, that's a good idea. Couple quick questions...

As a practical matter this feature would be added in the 0.7.0 release (described in #346 / implemented in #372) which contains a number of breaking changes for installation and configuration.

For sablier you'd begin declaring solidity-coverage as a plugin in your truffle config and the command would look like this:

truffle run coverage --config ../../.solcover.js 

The config path would be relative to the working_directory setting of the truffle config. Assume this would all be ok and there's nothing weird that Lerna does there but it would be nice to validate this feature on your project if you're open to that.

PaulRBerg commented 5 years ago

Is sablier the repo you'd target for this?

Exactly! Although I haven't yet pushed to remote my local integration of solidity-coverage.

You'd like it to be like solhint in the various package.jsons? e.g

Exactly x2!

Here's the scripts I currently have for eslint and solhint:

"lint:js": "eslint --ignore-path ../../.eslintignore .",
"lint:sol": "solhint --config ../../.solhint.json --max-warnings 0 \"contracts/**/*.sol\"",

Assume this would all be ok and there's nothing weird that Lerna does there but it would be nice to validate this feature on your project if you're open to that.

I'd love to! And yeah your example command seems to be exactly what I was thinking of.

cgewecke commented 5 years ago

@PaulRBerg Ok awesome. Am actively looking for industrial sized projects to validate the beta against and will be starting to do some installations and integration tests next week.

I will ping you then when it looks like it might be in good enough state to try out...

PaulRBerg commented 5 years ago

Cool!! I'm on Twitter and Telegram.

cgewecke commented 4 years ago

Published to latest with 0.7.0