Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Running coder results in a number of "red" warnings that are false positives, plus a fair number of "green" coding style issues. These are primarily:
- White space issues, particularly after foreach, around the dot (.) operator, and before the opening brace ({).
- Missing / incomplete @file docblocks.
- Trailing commas in one-line array -- e.g.
array('a' => 1, 'b' => 2,)
. - Spaces at the start or end of a translatable string. These fixes will have require re-translation, I believe, of the affected strings.
Comment | File | Size | Author |
---|---|---|---|
#2 | webform-coder_style_imperfections-2487748-2.patch | 20.19 KB | DanChadwick |
Comments
Comment #2
DanChadwick CreditAttribution: DanChadwick commentedCommitted to 7.x-4.x.
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedThe 8.x branch should run coder at some point. I don't think porting this patch would be a good use of time.
Comment #4
fenstratCommitted and pushed to 8.x-4.x.
Half way through a bunch of substantial changes in the 8.x branch, however I decided to port this before finishing those. It wasn't too tricky which made a nice change!
Comment #6
DanChadwick CreditAttribution: DanChadwick commentedOCD. It's contagious. :)
Comment #7
fenstratHaaa, that it is!
Comment #8
roball CreditAttribution: roball commentedThere are still some problems with the usage of t(). See the 13 Source code warnings at https://localize.drupal.org/translate/projects/webform/releases/438008 for details of Webform 7.x-4.8.
Comment #9
fenstrat@roball This issue is about minor code style fixes. Can you start a new issue for the t() fixes, thanks.
Comment #10
DanChadwick CreditAttribution: DanChadwick commentedPlease suggest solutions because I'm not at all sure that any of those t() issues are avoidable or reasonable. Just because coder says something doesn't make it true.
Comment #11
roball CreditAttribution: roball commentedOK, here is the new issue: #2488930: Interface text translatability warnings. You can see these warnings as part of the Coder Review module's code review when you have the Translation template extractor 7.x-1.x module installed.
Comment #12
roball CreditAttribution: roball commented@DanChadwick sorry I have to disagree. All 13 source code warnings for Webform 7.x-4.8 are actually true. In fact, they are even errors since the affected 13 strings can never be translated using Drupal's .po files.