Page MenuHomePhabricator

Add a linter rule for logical operators
ClosedPublic

Authored by joshuaspence on Apr 12 2015, 9:07 PM.
Tags
None
Referenced Files
F19790455: D12376.id29719.diff
Wed, Feb 25, 9:24 PM
F18822718: D12376.id29719.diff
Oct 23 2025, 8:07 AM
F18805654: D12376.id29708.diff
Oct 18 2025, 4:04 PM
F18758636: D12376.id29715.diff
Oct 5 2025, 11:02 PM
F18228953: D12376.id29719.diff
Aug 20 2025, 9:21 AM
F18228532: D12376.id29715.diff
Aug 20 2025, 7:36 AM
F18221996: D12376.diff
Aug 19 2025, 7:53 PM
F18173652: D12376.id29719.diff
Aug 15 2025, 7:56 PM
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.