Page MenuHomePhabricator

Use a regex to determine the list of sources for check-rpc-mappings
ClosedPublic

Authored by Fabien on Jul 29 2019, 12:51.

Details

Summary

This addresses @deadalnix comment from D3751.

The script used to take a constant list to determine the source files to
be parsed. This is not ideal as it is easy to forgot to add/remove one
when the code is updated.

This diff sets the input to a list of regexes so that the parsing
remains narrow scoped while reducing the amount of maintenance for the
script.

Test Plan
time ./test/lint/check-rpc-mappings.py .

Check the output is the same, and that there is no significant
performance drop.

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jasonbcox requested changes to this revision.Jul 31 2019, 01:18
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
test/lint/check-rpc-mappings.py
105 ↗(On Diff #10512)

Is it necessary for sources to be cast to a list? Pretty sure you can iterate over a set with a foreach loop.

This revision now requires changes to proceed.Jul 31 2019, 01:18
test/lint/check-rpc-mappings.py
105 ↗(On Diff #10512)

Clearly it's not, good catch.

This revision is now accepted and ready to land.Aug 5 2019, 15:46