yieldprotocol / fyDai

Yield Protocol v1
GNU General Public License v3.0
44 stars 14 forks source link

chore(formatting): Adds prettier-solidity plugin and formats contracts #387

Closed omarish closed 3 years ago

omarish commented 4 years ago

I was reading through the YieldSpace implementation (very nicely done, btw) and noticed a couple small formatting inconsistencies, so this PR adds and enables these formatting plugins:

This PR also adds another task to package.json: prettier:sol which will run all solidity code through prettier and write the formatted version. I would have named it lint:sol but that task name is already taken by solhint.

Finally, this PR touches a lot of solidity code and I haven't had a chance to look through very closely and make sure nothing was inadvertently changed by prettier (i.e if there's a bug in prettier that changes some solidity functionality by mistake). Ran the test suite and it's all passing.

aniemerg commented 4 years ago

@omarish is it possible to exclude files when running prettier? This appears to be a general improvement to style, but I think that it makes certain things worse, like the interface files. They go from being easy-to-skim function definitions to something far more unruly.

omarish commented 4 years ago

Yeah, absolutely. You can add a .prettierignore file with filename patterns you'd like to ignore.

alcueca commented 3 years ago

Too many conflicts, and the repo is being mostly archived.

omarish commented 3 years ago

Makes sense! I'm really impressed w/what you guys have built here. 💪