colonyNetwork icon indicating copy to clipboard operation
colonyNetwork copied to clipboard

Fix docgen script bugs

Open chmanie opened this issue 3 years ago • 0 comments

When running the natspec docgen script, two issues come up:

  • These warnings are generated:
Generating IColony documentation...
Warning: moveFundsBetweenPots _fromChildSkillIndex has no matching natspec comment
Warning: moveFundsBetweenPots _toChildSkillIndex has no matching natspec comment
Warning: moveFundsBetweenPots _fromPot has no matching natspec comment
Warning: moveFundsBetweenPots _toPot has no matching natspec comment
Warning: moveFundsBetweenPots _amount has no matching natspec comment
Warning: moveFundsBetweenPots _token has no matching natspec comment

Even though the natspec comments are provided. This is due to a shortcoming that is already mentioned in the docgen itself: https://github.com/JoinColony/colonyNetwork/blob/869c7d8233dcb1314b5fd3606e688ce8107d1c3c/scripts/docgen.js#L88

  • Furthermore the solidity-parser used seems outdated and also issues some warnings when run:
(node:127654) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
    at emitCircularRequireWarning (node:internal/modules/cjs/loader:707:11)
    at Object.get (node:internal/modules/cjs/loader:721:5)
    at Object.<anonymous> (/home/chris/dev/colony/colonyNetwork/node_modules/solidity-parser-diligence/dist/antlr4/RuleContext.js:32:46)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/chris/dev/colony/colonyNetwork/node_modules/solidity-parser-diligence/dist/antlr4/PredictionContext.js:10:19)
(node:127654) Warning: Accessing non-existent property 'INVALID_ALT_NUMBER' of module exports inside circular dependency
    at emitCircularRequireWarning (node:internal/modules/cjs/loader:707:11)
    at Object.get (node:internal/modules/cjs/loader:721:5)
    at Object.<anonymous> (/home/chris/dev/colony/colonyNetwork/node_modules/solidity-parser-diligence/dist/antlr4/tree/Trees.js:15:49)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/home/chris/dev/colony/colonyNetwork/node_modules/solidity-parser-diligence/dist/antlr4/RuleContext.js:126:13)

I assume this can be alleviated by switching to https://github.com/solidity-parser/parser which probably also supports newer Solidity versions.

chmanie avatar Jun 21 '22 15:06 chmanie