Page MenuHomePhabricator

[LINTER] Revive the locale dependent functions linter in arcanist
ClosedPublic

Authored by Fabien on Apr 26 2019, 13:14.

Details

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.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
arcanist_locale_dependence
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 5629
Build 9320: Bitcoin ABC Buildbot (legacy)
Build 9319: arc lint + arc unit

Event Timeline

jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
arcanist/linter/LocaleDependenceLinter.php
5 ↗(On Diff #8281)

verytricky -> very tricky

227 ↗(On Diff #8281)

should be on the same line as array( since it's empty.

This revision is now accepted and ready to land.Apr 29 2019, 17:46
This revision was automatically updated to reflect the committed changes.