Automated testing now reports on coding standards violations - see #1299710: [meta] Automate the coding-standards part of patch review. Any file which is altered by a patch gets a full list of standards faults, not just in the lines which are altered by the patch.
The Scheduler 8.x code is clean - see #2861902: Fix coding standards violations in 8.x codebase, now we need to do the 7.x code. As at 26 April there are 194 coding standards notices - see https://www.drupal.org/pift-ci-job/657360
The 7.x code was compliant back in October 2013 #1566024: Coding Standards and Coder Review but the standards have moved on since then.
Comment | File | Size | Author |
---|---|---|---|
#24 | 2872885-24.more_coding_standards.patch | 5.37 KB | jonathan1055 |
|
Comments
Comment #2
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThere are currently 189 coding standards messages over the entire codebase at PHP5.3 and 196 messages at PHP5.4+
This patch fixes tests/scheduler.test, which I want to be clean before adding more tests. Because the entire file is checked and all infringements reported, having it clean before adding new tests makes it easier to check that the additons are compliant.
Comment #5
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedAfter scheduler.test the standards messages reduced to 145.
Here's a patch for scheduler.admin.inc
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedIntersting that one coding standards message "Do not concatenate strings to translatable strings, they should be part of the t() argument and you should use placeholders" (Drupal.Semantics.FunctionT.ConcatString) is detected on d.o. running PHP5.3 but is allowed and not classed as a problem at PHP5.4+ (hence why it slipped through)
Comment #8
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedDown to 137 messages after fixing scheduler.admin.inc
Here's a patch for readme.txt, scheduler.api.php and scheduler.cron.inc
Comment #10
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedDown to 114 messages after fixing readme, api.php and cron.inc
Here's a patch for fixing .drush.inc, .edit.inc, .info and .install
Comment #12
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedDown to 102 now.
Here's a patch for .module
Comment #14
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedDown to 59 messages.
Patch for .rules.inc, rules_defaults.inc, tokens.inc and views.inc. Plus one 'drupal practice' fix for .install which was missed before.
Comment #16
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedNow only 28 messages left to fix.
Here's a patch for tests/scheduler_api.test and scheduler_handler_field_scheduler_countdown.inc (which also required a change in scheduler.views.inc).
This should be the last coding standards patch, but there may be one more for Drupal Practice. However, some of those suggestions may not be fixable.
Comment #18
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedRemaining coding standards messages: ZERO :-)
Comment #19
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHere is a patch which fixes two of the three files with coding practice messages. As these are not reported in d.o. tests, the violations that this patch fixes are:
and
Comment #21
DamienMcKennaAny further work planned for this? You might just run phpcbf on the codebase and see what happens. I ran it and the only change that showed was on the JS file.
Comment #22
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks for pointing this out. My
phpcs
alias had a long list of--extensions
but 'js' was missing, hence I never saw these.Interestingly my version reports different fixes to yours. I have
which yours did not fix. But the indentation and @see are not reported in my list.
Comment #24
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedNone of these are reported on d.o. testing.
Patch fixes 1 and 3 and sets to ignore 2 and 4.
Comment #26
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commented7.x coding standards and best practices now have no warnings on d.o. testbot output, running coder 7.x-2.6 and using drupalcs and drupalcsp.
So I think we can close this issue as fixed.