ethereum-optimism / ecosystem-contributions

Find ways to contribute to the Optimism Collective
MIT License
289 stars 98 forks source link

✨ Contribution Opportunity: Optimism Monorepo Solidity style linter #62

Open smartcontracts opened 1 year ago

smartcontracts commented 1 year ago

What is a Contribution Opportunity?

A Contribution Opportunity is a concrete task that you can work on to contribute to the Optimism Collective.


Summary

The Optimism Monorepo is one of the primary places where work happens on the OP Stack, the open source software stack that powers the Optimism Collective. The Optimism Monorepo enforces a style guide for its smart contracts. Currently, this style guide is largely enforced by PR review, a process that does not scale as external contributors begin to contribute additional smart contracts.

The Optimism Monorepo is looking for a Solidity style linter that can enforce the style guide programmatically rather than via PR review. Please refer to the style guide for an exact list of conventions currently in use.

Potential Features

Impact

Programmatically checking the style guide will significantly simplify the process of contributing to the monorepo. Engineering time will no longer have to be spent reviewing style nits, which will speed things up while also reducing headaches for external contributors. Win win!

tynes commented 1 year ago

forge fmt + git diff

smartcontracts commented 1 year ago

@tynes does forge fmt enforce our style guide? I was under the impression it did not

smartcontracts commented 1 year ago

Moving this into "Paused" for now while we discuss what we want to do with this

dbale-altoros commented 3 months ago

Moving this into "Paused" for now while we discuss what we want to do with this

@smartcontracts Hello, I'm tech lead in Solhint https://protofire.io/projects/solhint I found this issue and thought maybe we can do this using the same core as for solhint Do you have a doc with the style guide ? because the links take me to a repo with many contracts

z3r086 commented 2 weeks ago

What is a Contribution Opportunity?

A Contribution Opportunity is a concrete task that you can work on to contribute to the Optimism Collective.

Summary

The Optimism Monorepo is one of the primary places where work happens on the OP Stack, the open source software stack that powers the Optimism Collective. The Optimism Monorepo enforces a style guide for its smart contracts. Currently, this style guide is largely enforced by PR review, a process that does not scale as external contributors begin to contribute additional smart contracts.

The Optimism Monorepo is looking for a Solidity style linter that can enforce the style guide programmatically rather than via PR review. Please refer to the style guide for an exact list of conventions currently in use.

Potential Features

  • Support the Optimism Monorepo Solidity style guide
  • Throw an error when the style guide is not enforced and explain where the issue comes from
  • Create a CI task that will run the linter in CI
  • Bonus points, provide a --fix option to automatically fix style issues

Impact

Programmatically checking the style guide will significantly simplify the process of contributing to the monorepo. Engineering time will no longer have to be spent reviewing style nits, which will speed things up while also reducing headaches for external contributors. Win win!