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)
Fri, Nov 22, 2:27 PM
Unknown Object (File)
Wed, Oct 30, 6:45 AM
Unknown Object (File)
Oct 23 2024, 1:16 AM
Unknown Object (File)
Oct 18 2024, 12:46 PM
Unknown Object (File)
Oct 8 2024, 9:20 AM
Unknown Object (File)
Sep 20 2024, 2:45 PM
Unknown Object (File)
Sep 7 2024, 8:17 AM
Unknown Object (File)
Sep 7 2024, 6:32 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
Branch
master
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 5268
Build 5286: [Placeholder Plan] Wait for 30 Seconds

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.