Skip to content

Add --pretty flag to forge inspect methods for grouped, tabular method output #1500

Description

@JuanXavier

Component

Forge

Describe the feature you would like

When reading methods from contracts in a project via forge inspect src/MyContract.sol:MyContract methods, all externally accesible functions are shown in alphabetical order.

I think it would be awesome if when running forge inspect src/MyContract.sol:MyContract methods --pretty, we could get the layout changed to a table where view functions are clearly distinguished from state-changing functions, but they could maintain the alphabetical order. For example:

Function Signature Visibility Mutability Returns Signature
balanceOf(address) external view uint256 0x70a08231
calculateReward(address,uint256) external pure uint256 0x3d18b912
getOwner() public view address 0x8da5cb5b
name() public view string 0x06fdde03
symbol() public view string 0x95d89b41
totalSupply() public view uint256 0x18160ddd
-------------------------------------- ----------- ------------ ------------- --------------
approve(address,uint256) external nonpayable bool 0x095ea7b3
burn(uint256) external nonpayable 0x42966c68
claimRewards() public nonpayable 0x3d6ab68f
mint(address,uint256) public nonpayable 0x40c10f19
transfer(address,uint256) external nonpayable bool 0xa9059cbb

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions