Page MenuHomePhabricator

[LINTER] Improve check-doc regex
ClosedPublic

Authored by Fabien on Mar 16 2019, 09:59.

Details

Summary

Improve the regex:

  • Use Perl type regex in grep to remove duplication. Previously there

was 2 alsmost identical regex, one posix compliant for egrep and one
Perl compliant for python re.

  • Exclude the test folder from the source path rather than subtracting

its matching output

This improvements make the -h now detectable; it is added to the
undocumented exceptions.

Inspired from core PR12820.
Note that GNU grep is used instead of git grep to allow for
multiline regex (required due to our code format).

Test Plan

Should return no error:

arc lint

./test/lint/check-doc.py

There should be 1 more used argument than before this patch (-h),
otherwise the output should be identical.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
check_doc_update_part1
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5227
Build 8517: Bitcoin ABC Buildbot (legacy)
Build 8516: arc lint + arc unit