Page MenuHomePhabricator

Add a linter rule for spacing after a cast
ClosedPublic

Authored by joshuaspence on Apr 8 2015, 1:42 PM.
Tags
None
Referenced Files
F14774841: D12321.id30998.diff
Fri, Jan 24, 2:19 AM
F14774840: D12321.id30997.diff
Fri, Jan 24, 2:19 AM
F14774839: D12321.id30878.diff
Fri, Jan 24, 2:19 AM
F14774838: D12321.id30693.diff
Fri, Jan 24, 2:19 AM
F14774836: D12321.id29693.diff
Fri, Jan 24, 2:19 AM
F14774835: D12321.id29605.diff
Fri, Jan 24, 2:19 AM
F14774834: D12321.id29604.diff
Fri, Jan 24, 2:19 AM
F14774833: D12321.id.diff
Fri, Jan 24, 2:19 AM
Subscribers

Details

Summary

Ref T7409. Add a linter rule to ensure that a cast is not followed by a space. This is largely based on Generic_Sniffs_Formatting_NoSpaceAfterCastSniff.

Test Plan

Added unit tests.

Diff Detail

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

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for spacing after a cast.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.

I want to retain the current rule. I believe we're consistent about it everwhere.

(I don't think I've personally ever seen real code using the (type) var style.)

This revision now requires changes to proceed.Apr 8 2015, 7:27 PM

That's fine with me, I don't care about it too much. It does raise the question of configuring the ArcanistXHPASTLinter though... Currently the linter imposes a certain style which can be selectively enabled or disabled but not configured. We could reasonably add a xhpast.space-after-cast configuration but doing this for every linter rule seems like a lot of work.

joshuaspence edited edge metadata.

Prefer no space after cast

epriestley edited edge metadata.
This revision is now accepted and ready to land.May 17 2015, 2:48 PM
This revision was automatically updated to reflect the committed changes.