kleros / builder-baseline

A baseline for the Kleros Builder covering architectural, UX, security, coding styles, tooling decisions.
MIT License
0 stars 0 forks source link

Fix non-standard NatSpec #2

Closed jaybuidl closed 7 months ago

jaybuidl commented 1 year ago

Change

Prefix the following RAB tags with custom:: authors, reviewers, auditors, bounties, deployments, tools.

Motivation

As @greenlucid found out, our current RAB annotations does not conform to NatSpec and some parsers choke on it.

This would apply only to new undeployed contracts.

Note: the @author tag singular is standard NatSpec but @authors is not.

Example

Example seen in the wild of custom co-author natspec

/**
 * @title ...
 * @custom:version 1.0
 * @notice ...
 * @custom:coauthor foobar (0xfoobar)
 * @custom:coauthor wwchung (manifoldxyz)
 * ...
 * @custom:coauthor ryley-o (artblocks)
 */

Migration script

# To mass migrate a code base
for tag in authors reviewers auditors bounties deployments tools
do
    find ./src/ -type f -name '*.sol' | xargs sed -i.bak "s/@$tag/@custom:$tag/"
done

# To revert
git restore src/
rm src/**/*.sol.bak