HomePhabricator

[LINTER] Revive the locale dependent functions linter in arcanist

Description

[LINTER] Revive the locale dependent functions linter in arcanist

Summary:
This diff removes the linter bash script to integrate a PHP equivalent
one into arcanist. Calling the bash script through arcanist was time
consuming (see D2705 and D2804).
By not calling any external program, this runs much faster than the
previous version.

This PHP version is equivalent to the bash one, with one minor
improvement: it can detect multiple occurrences of locale dependent
functions on a single line.
This case occurs once in the codebase in the src/test/getarg_tests.cpp
file where boost::is_space was masked by boost::split on the same
line. An exception as been added for this case.

Tested arc lint --everything with this single linter activated, it
took less than a second to run on my machine.

Test Plan:

arc lint --everything

Should return:

OKAY No lint warnings.

Comment any of the known violations (const KNOWN_VIOLATIONS at the
beginning of the LocaleDependenceLinter.php file). Then add a comment in
the corresponding source file, and run:

arc lint

It should throw the errors for the functions associated with the file
from the known exceptions.

Reviewers: #bitcoin_abc, deadalnix, jasonbcox

Reviewed By: #bitcoin_abc, jasonbcox

Subscribers: jasonbcox

Differential Revision: https://reviews.bitcoinabc.org/D2880

Details

Provenance
FabienAuthored on Apr 26 2019, 09:58
FabienPushed on May 7 2019, 11:29
Reviewer
Restricted Project
Differential Revision
D2880: [LINTER] Revive the locale dependent functions linter in arcanist
Parents
rABCeb91c18c4b3e: Merge #9693: Prevent integer overflow in ReadVarInt.
Branches
Unknown
Tags
Unknown