Active
Project:
Coder
Version:
8.x-2.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Apr 2016 at 18:31 UTC
Updated:
7 Mar 2026 at 09:54 UTC
Jump to comment: Most recent
Add a new rule in coder which will sniff for e.g and i.e. (with or without the preceding '.' in the end) in comments, documentations and strings.
The literals e.g. and i.e. should be replaced with English words "for example," and "that is," respectively.
Comments
Comment #2
imalabyaComment #3
avpadernoI am not sure such rule would work, since:
It is true that many times they are over-used, and often they are used in a ungrammatical and inappropriate way, but a rule trying to fix the grammaticality of a sentence will probably not work.
Comment #4
quietone commentedI was making a change in #2939645: The sample batch finished callback function should have the fourth parameter that included the use of e.g. and decided to check the proper usage. I search the net and found conflicting examples and then searched Drupal coding standards (nothing there) and then the issue queue and found this issue. It would be very helpful to know what to do with the e.g. I am editing.
What needs to happen next here to reach a decision?
Comment #5
avpadernoi.e. stands for that is or in other words. e.g. stands for for example.
e.g. in that case is correct, since what follows is just an example of acceptable input. It can be replaced with for example, if you want to avoid using e.g.
Comment #6
xjmI don't think we need the coder rule to offer a
phpcbffix for an automatic replacement, since that may require human language skill. I think we just need it to flag them inphpcs.Comment #7
quietone commentedThe related issue in the Coding standards project has been closed as won't fix. #2760911: Use of "e.g." and "i.e."