Page MenuHomePhabricator

Add a linter rule for logical operators
ClosedPublic

Authored by joshuaspence on Apr 12 2015, 9:07 PM.
Tags
None
Referenced Files
F18173652: D12376.id29719.diff
Fri, Aug 15, 7:56 PM
F18081196: D12376.id.diff
Mon, Aug 4, 10:56 PM
F18052354: D12376.diff
Mon, Aug 4, 2:16 AM
Unknown Object (File)
May 7 2025, 3:42 AM
Unknown Object (File)
Apr 29 2025, 7:57 PM
Unknown Object (File)
Apr 13 2025, 11:14 PM
Unknown Object (File)
Apr 13 2025, 4:02 AM
Unknown Object (File)
Apr 11 2025, 9:37 AM
Subscribers

Details

Summary

Ref T7409. Adds ArcanistXHPASTLinter::LINT_LOGICAL_OPERATORS for advising:

  • && in favor of and.
  • || in favor of or.

Based on Squiz_Sniffs_Operators_ValidLogicalOperatorsSniff.

Test Plan

Added test cases.

Diff Detail

Repository
rARC Arcanist
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

joshuaspence retitled this revision from to Add a linter rule for logical operators.
joshuaspence updated this object.
joshuaspence edited the test plan for this revision. (Show Details)
joshuaspence added a reviewer: epriestley.
epriestley edited edge metadata.
This revision is now accepted and ready to land.Apr 12 2015, 9:10 PM
src/lint/linter/ArcanistXHPASTLinter.php
3471

Should be %s, not %.

3479

Likewise.

joshuaspence edited edge metadata.

Rebase, fix pht format string

This revision was automatically updated to reflect the committed changes.