| Project: | Coder |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | major |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
When I have the following in my .info file.....
name = 'Ubuntu Drupal Theme'
description = 'Ubuntu-Drupal is a theme for Ubuntu LoCo web sites.'
version = 6.4.0
core = '6.x'
engine = phptemplate
stylesheets[all][] = style.css
regions[banner] = Banner
regions[left] = Left sidebar
regions[right] = Right sidebar
regions[content] = Content
regions[header] = Header
regions[footer] = Footer
I get these errors:
udtheme.info
*
severity: normalLine 8: string concatenation should be formatted with a space separating the operators (dot .) and non-quote terms
stylesheets[all][] = style.css
*
severity: normalLine 8: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
stylesheets[all][] = style.css
*
severity: normalLine 10: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
regions[banner] = Banner
*
severity: normalLine 11: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
regions[left] = Left sidebar
*
severity: normalLine 12: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
regions[right] = Right sidebar
*
severity: normalLine 13: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
regions[content] = Content
*
severity: normalLine 14: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
regions[header] = Header
*
severity: normalLine 15: use quotes around a string literal array index, this is not only a style issue, but a known performance problem
regions[footer] = Footer
Comments
#1
This is also happening for me in my theme's .info file. As previously said it just looks like the file is being incorrectly evaluated as PHP.
#2
Confirming this issue, for me thats the only files its looking at in my themes, I know there are coding standards errors in 8 files and it doesn't pick them up (inc files for custom Panel layouts).
#3
lol... For the heck of it I made one of my bigger themes conform to the standards it wanted to force. It broke pretty completely. Doesn't look like the authors feel like fixing it.
#4
I'm bumping up the priority because this seems of have been blown off and a user trying to follow the suggestion will actually break things.
#5
Haven't been able to fix yet but I'll try my hand at it. For now here's a failing simpletest
#6
Actually that test sucks, please disregard. I'm not really sure how to simulate this with the current testing suite but I'll try a little bit more. For now please checkout this patch and see if it fixes your problem. The algorithm is correctly identifying that file as not php but because of some commented out code it still checks it as if it were php anyways. Sorta feels like that $is_php_file variable isn't doing anything or is slightly mucked up.
We really need to have sample files for our tests. Right now the logic that detects whether a file should be checked isn't really tested at all so we're probably breaking each other pretty often.
#7
This patch fixes it for me. Excellent!
#8
Patch in #6 is a start, but it is not complete, I still get those when using it along with coder_tough_love:
This happens because some code review rules still want the bidimensional
all_array_linesvariant.The attached patch should be better and it allows to still catch non-php errors in
.infofiles, I tested it with trailing spaces, for instance.Maybe the non-php checks can be applied to javascript and css files as well?
Regards,
Antonio
P.S. If the patch is OK it can be applied with
git amso I get attribution in the gt history.