Page MenuHomePhabricator

Add a linter rule for logical operators
ClosedPublic

Authored by joshuaspence on Apr 12 2015, 9:07 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 2:15 AM
Unknown Object (File)
Mon, Apr 1, 3:56 PM
Unknown Object (File)
Sat, Mar 30, 2:58 PM
Unknown Object (File)
Mar 20 2024, 6:05 PM
Unknown Object (File)
Feb 17 2024, 2:24 PM
Unknown Object (File)
Jan 5 2024, 8:26 AM
Unknown Object (File)
Dec 29 2023, 3:11 PM
Unknown Object (File)
Dec 23 2023, 10:50 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.