Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: "@inheritdoc is missing" when function is not inherited #60

Open
smartcontracts opened this issue Nov 24, 2024 · 2 comments
Open

Comments

@smartcontracts
Copy link

Ran npx @defi-wonderland/natspec-smells --include "src/L2/ETHLiquidity.sol" here https://github.com/ethereum-optimism/optimism/pulls
https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L2/ETHLiquidity.sol.

I get @inheritdoc is missing for some functions that should not require this at all:

src/L2/ETHLiquidity.sol:30
ETHLiquidity:burn
  @inheritdoc is missing

src/L2/ETHLiquidity.sol:38
ETHLiquidity:mint
  @inheritdoc is missing

Note that neither of these functions are inherited.

@smartcontracts
Copy link
Author

I guess this repo assumes that all contracts are using interfaces? I will probably just end up disabling @inheritdoc but interesting either way

@0xteddybear
Copy link
Contributor

I guess this repo assumes that all contracts are using interfaces?

That is indeed the case! We are pushing to have the entirety of a contract's ABI extracted into interfaces as a best practise, since:

  • Interfaces can be exported with a more lax pragma solidity, making integrations less painful
  • Having most natspec on the interface allows the contracts to be more implementation-dense
  • When trying to learn about the codebase, it should be enough to read the interfaces you're interested in to understand what a contract does, only having to dive into the implementation if you are interested in the how

We understand it can be painful to separate every contract into interface and implementation, especially for existing codebases, and not everybody will agree on the value said separation provides, so we provide the option to disable that check by setting enforceInheritdoc to false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants