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
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Fabien created this revision.Jul 29 2019, 12:51
Herald added a reviewer: Restricted Project. · View Herald TranscriptJul 29 2019, 12:51
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
Fabien updated this revision to Diff 10538.Jul 31 2019, 07:51

Avoid a useless cast.

Fabien added inline comments.Jul 31 2019, 07:52
test/lint/check-rpc-mappings.py
105 ↗(On Diff #10512)

Clearly it's not, good catch.

deadalnix accepted this revision.Aug 2 2019, 00:40
jasonbcox accepted this revision.Aug 5 2019, 15:46
This revision is now accepted and ready to land.Aug 5 2019, 15:46