OpenZeppelin / solidity-docgen

Documentation generator for Solidity projects
MIT License
452 stars 118 forks source link

`Expected @return tag to start with name ...` #410

Closed kyzooghost closed 2 years ago

kyzooghost commented 2 years ago

Using solidity-docgen 0.6.0-beta.26, when attempting npx hardhat docgen command for .sol file containing the following

    /**
     * @notice ...
     * @return number
     */
    function getNumber() external view returns (uint256 number) {
        number = 0;
        return number;
    }

The command will error with Error: Expected @return tag to start with name 'weight'

I've found that the error will be avoided with a few extra characters on the same line after @return number, but it can be frustrating to need to add a short comment after each @return-tagged comment line.

frangio commented 2 years ago

There was a difference between solc and the plugin's expected NatSpec format. @param requires a description but @return doesn't, the plugin was treating both the same.

Should be fixed on latest by https://github.com/OpenZeppelin/solidity-docgen/commit/44a2296ec94855cf10bb836a3315cdfc9fa9239e.