Page MenuHomePhabricator

Add lint rules for `=>` (fat arrow) and `.` (string concatenation)
ClosedPublic

Authored by epriestley on May 27 2014, 10:52 PM.
Tags
None
Referenced Files
F14035178: D9314.diff
Sun, Nov 10, 4:38 AM
F14024344: D9314.diff
Thu, Nov 7, 8:24 AM
F13996175: D9314.id22095.diff
Wed, Oct 23, 6:39 PM
F13985623: D9314.id22096.diff
Sun, Oct 20, 9:51 PM
F13984797: D9314.id.diff
Sun, Oct 20, 4:03 PM
F13984783: D9314.id.diff
Sun, Oct 20, 3:58 PM
F13984774: D9314.diff
Sun, Oct 20, 3:51 PM
F13979094: D9314.id22094.diff
Sat, Oct 19, 2:35 AM
Subscribers

Details

Summary

We have coverage for normal binary operators, but not these unusual cases.

Test Plan

Added and executed unit tests.

Diff Detail

Repository
rARC Arcanist
Branch
wlint
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 729
Build 729: [Placeholder Plan] Wait for 30 Seconds

Event Timeline

epriestley retitled this revision from to Add lint rules for `=>` (fat arrow) and `.` (string concatenation).
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added reviewers: joshuaspence, btrahan.
joshuaspence edited edge metadata.

I'll accept this because it works and is mostly fine, but there's a couple of minor inlines.

src/lint/linter/ArcanistXHPASTLinter.php
49

Just a though (not really related to this diff), but whenever a new rule is added, I think that the output of getVersion and getCacheVersion should probably change as well.

109

Also note related to this diff, but these strings should be wrapped in pht?

1971

Do you need keys here? Wouldn't foreach (array($prev, $next) as $wtoken) { achieve the same thing?

This revision is now accepted and ready to land.May 27 2014, 11:08 PM
epriestley edited edge metadata.
  • Bump verison.
  • We should probably pht() everything at some point.
  • To be completely correct, the rule for prev should disallow newlines (i.e., $a\n.$b is not conventional), but that's kind of complicated and I haven't seen anyone doing it so I didn't bother yet.
epriestley updated this revision to Diff 22096.

Closed by commit rARCff97a77786d0 (authored by @epriestley).