Closed (won't fix)
Project:
Coder
Version:
7.x-2.x-dev
Component:
Coder Sniffer
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Oct 2012 at 09:11 UTC
Updated:
10 Oct 2016 at 11:46 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
lars toomre commentedAttached is an untested work-in-progress patch that creates a new sniff PhraseCommentSniff.php and an a bad.docblock file.
It addresses this issue, the incorrect use of 'e.g.' and 'i.e.', 'Page callback:' phrase use and form constructor/validate/submit docblocks.
As this is my first time developing any thing for PHP_CodeSniffer, I would enjoy receiving feedback on my approach.
I also could use some help with methods getHookCode(), getFormDefinitionFunctionName() and getFormFunctions(). Thanks in advance.
Comment #2
douggreen commentedThis is pretty trivial using the regex rules. Why the sniff? Something like this would likely work, a couple dozen lines of code instead of 1000???
I hope this example helps. Why try this in a sniff? Coder does a bunch of lexical analysis (that phase done before parsing), so that what you get is just the stream of text you want (comment, quote, php, etc). If we really wanted to detect stuff in a docblock verses a comment, that would be very easy to add to what we already have.
Comment #3
klausiCoder 7.x is frozen now and will not receive updates. Coder 8.x-2.x can be used to check code for any Drupal version, Coder 8.x-2.x also supports the phpcbf command to automatically fix conding standard errors. Please check if this issue is still relevant and reopen against that version if necessary.