Would it be possible to support coder format minor warnings for

- Line lengths over 80 chars
- Comments beginning with lowercase character
- Comments not ending in punctuation

??

There are only vague/indirect references to this in the coding standards, so it can't really be enforced on that basis I think, but some developers might like to pull their socks up a bit more than others?

Comments

danielb’s picture

aspilicious’s picture

Line lengths over 80 chars is *only* a problem for comments in the header of functions.
Some comments like @see ...() don't need the dot.

So it is very hard to check those.

danielb’s picture

I don't understand what you mean. Are you saying it is not possible to test how many characters a line has?

aspilicious’s picture

It is possible but sometimes it is allowed to exceed 80 characters.
So you can't say that comments bigger than 80 characters aren't allowed in every case.

Example

/*
* Docblock can't exceed 80 characters
*/
function test() {
foo() // this can exceed 80 chracters foooooooooooooooooooooooooooooooooooooooooooooooooooo bar
}

psynaptic’s picture

I want this.

I like what coder tough love is doing and want coder format to be able to format using these rules but they all are structured differently: coder tough love seems to extend coder, adding some more rules whereas coder format has its own parser which uses PHP's parser tokens.

I think what we need is a unified way of parsing Drupal source code. Maybe we just need to port coder_format to use grammar parser module?

sun’s picture

Component: Coder Format » Review/Rules

Comment in #4 is invalid. Only the phpDoc summary is allowed to exceed 80 chars.

However, this entire issue talks about warnings. coder_format does not output warnings, it takes action. Wrong component, I guess.

klausi’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Coder for Drupal 6 is now frozen and only security fixes will be applied. Feel free to update this issue and reopen against 7.x-2.x or 8.x-2.x.