Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
apadernoI 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 CreditAttribution: quietone as a volunteer 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
apadernoi.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
phpcbf
fix for an automatic replacement, since that may require human language skill. I think we just need it to flag them inphpcs
.