defi-wonderland / natspec-smells

👃Automatically identify missing or incomplete natspec
MIT License
90 stars 7 forks source link

feature request - new config options: enableEvents, enableInternalFunctions #35

Open devtooligan opened 7 months ago

devtooligan commented 7 months ago

This would be more helpful to me if we could disable events and internal functions. These two new config options could be default true to maintain the current default behavior.

The current output is a really tall column of text that mixes events and both internal and external functions and I only care about external functions so it's a bit difficult to triage. And the contract I tried it on was short, would probably be unmanageable if it was much longer.

Anyways, great job on making this!

Very helpful

devtooligan commented 7 months ago

to be clear, i am including private with internal

gas1cent commented 7 months ago

Hey @devtooligan, thanks for the feedback! Having more control over the rules being applied totally makes sense, we're currently discussing the best way to achieve this. Most likely, we will add a rules option, something like

[
  { events: 'inheritdoc' },
  { enums: 'off' },
  'errors',
  {
    functions: [
      'external',
      'public',
      { internal: { tags: ['dev'] } }
    ]
  },
]

So one could switch between inheritdoc and natspec, enable/disable validation of certain nodes, such as enums, exclude function types from the check and specify what tags are used for the rest. Feel free to suggest more options if you come across a codebase that would benefit from them.