CommentFileSizeAuthor
#62 color-module-color-review-1530724-62.patch8.58 KBrevagomes
#59 color-module-color-review-1530724-59.patch8.6 KBoriol_e9g
#56 interdiff-53-56.txt8.17 KBrajendar reddy
#56 color.module-pass_coder_review-1530724-56.patch9.95 KBrajendar reddy
#53 interdiff-51-53.txt1.68 KBcs_shadow
#53 color.module-pass_coder_review-1530724-53.patch10.19 KBcs_shadow
#51 interdiff-45-51.txt1.94 KBcs_shadow
#51 color.module-pass_coder_review-1530724-51.patch8.41 KBcs_shadow
#45 color.module-pass_coder_review-1530724-45.patch10.38 KBcs_shadow
#39 interdiff-36-39.txt1.9 KBcs_shadow
#39 color.module-pass_coder_review-1530724-39.patch12.33 KBcs_shadow
#36 interdiff-34-36.txt2.13 KBcs_shadow
#36 color.module-pass_coder_review-1530724-36.patch12.17 KBcs_shadow
#34 1530724-color_pass_coder-34.patch10.38 KBvisabhishek
#34 interdiff-1530724-32-34.txt3.31 KBvisabhishek
#32 interdiff.txt1.54 KBsriharsha.uppuluri
#32 1530724-color_pass_coder-32.patch6.98 KBsriharsha.uppuluri
#30 1530724-color_pass_coder-30.patch5.35 KBvisabhishek
#28 1530724-color_pass_coder-28.patch5.56 KBvisabhishek
#24 1530724-color_pass_coder-24.patch4.8 KBThisIsDog
#21 1530724-color_pass_coder-21.patch5.22 KBdeepakaryan1988
#18 1530724-color_pass_coder-18.patch8.02 KBchrisfromredfin
#12 drupal-color-coder-cleanup-1530724-5.patch9.21 KBpuregin
#4 drupal-color-coder-cleanup-1530724-4.patch8.67 KBramlev
#3 drupal-color-coder-cleanup-1530724-3.patch4.92 KBramlev
#2 drupal-1530724-2.patch5.97 KBroborn
#1 drupal-1530724-1.patch3.47 KBtraviscarden

Comments

traviscarden’s picture

Assigned: Unassigned » traviscarden
Status: Active » Needs review
StatusFileSize
new3.47 KB
roborn’s picture

StatusFileSize
new5.97 KB
FILE: /Sites/htdocs/d8review/core/modules/color/preview.html
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
--------------------------------------------------------------------------------
 7 | ERROR | Files must end in a single new line character
--------------------------------------------------------------------------------

FILE: /Sites/htdocs/d8review/core/modules/color/color.module
--------------------------------------------------------------------------------
FOUND 15 ERROR(S) AFFECTING 14 LINE(S)
--------------------------------------------------------------------------------
 254 | ERROR | Inline comments must end in full-stops, exclamation marks, or
     |       | question marks
 256 | ERROR | Inline comments must end in full-stops, exclamation marks, or
     |       | question marks
 262 | ERROR | Inline comments must end in full-stops, exclamation marks, or
     |       | question marks
 461 | ERROR | There must be no blank line following an inline comment
 571 | ERROR | Inline comments must end in full-stops, exclamation marks, or
     |       | question marks
 596 | ERROR | There must be no blank line following an inline comment
 598 | ERROR | Inline comments must start with a capital letter
 697 | ERROR | Expected 1 space before "*"; 0 found
 697 | ERROR | Expected 1 space after "*"; 0 found
 712 | ERROR | Inline control structures are not allowed
 713 | ERROR | Inline control structures are not allowed
 714 | ERROR | Inline control structures are not allowed
 738 | ERROR | Inline control structures are not allowed
 739 | ERROR | Inline control structures are not allowed
 740 | ERROR | Inline control structures are not allowed
--------------------------------------------------------------------------------

Updated patch to fix these errors.

ramlev’s picture

StatusFileSize
new4.92 KB

Cleaned the code, to parse the drupal coder / codesniffer.

ramlev’s picture

StatusFileSize
new8.67 KB

The patch in #3, is not complete, the color.module file wasen't added to the patch.

Heres a new try.

Status: Needs review » Needs work
Issue tags: -Novice, -Coding standards, -coder-fixes-2012

The last submitted patch, drupal-color-coder-cleanup-1530724-4.patch, failed testing.

jeff.esquivel’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work
Issue tags: +Novice, +Coding standards, +coder-fixes-2012

The last submitted patch, drupal-color-coder-cleanup-1530724-4.patch, failed testing.

ramlev’s picture

Im fixing the patch and submitting it soon

traviscarden’s picture

Status: Needs work » Postponed

Postponing till feature freeze. If you want to help in the meantime, please work on the blockers on the meta issue. Thanks!

sphism’s picture

Status: Postponed » Active

We have the go ahead with all these issues again, see #1518116: [meta] Make Core pass Coder Review for more details

markhalliwell’s picture

Assigned: traviscarden » Unassigned
Status: Active » Needs work
Issue tags: +Needs reroll
puregin’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new9.21 KB

Re-rolled

markhalliwell’s picture

Status: Needs review » Needs work

Thanks @puregin! Here's a few reviews:

  1. +++ b/core/modules/color/color.module
    @@ -229,9 +229,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) {
     /**
      * Prepares variables for color scheme form templates.
      *
    - * Default template: color-scheme-form.html.twig.
    - *
    - * @param array $variables
    + * @param Array $variables
    

    Comment should probably be:
    Prepares variables for color-scheme-form.html.twig.

  2. +++ b/core/modules/color/color.module
    @@ -246,8 +244,21 @@ function template_preprocess_color_scheme_form(&$variables) {
    -  $form['scheme']['#attached']['js'][$preview_js_path] = array('weight' => -1);
    -
    +  drupal_add_js($preview_js_path, array('weight' => -1));
    +
    +  $output  = '';
    +  $output .= '<div class="color-form clearfix">';
    +  // Color schemes.
    +  $output .= drupal_render($form['scheme']);
    +  // Palette.
    +  $output .= '<div id="palette" class="clearfix">';
    +  foreach (element_children($form['palette']) as $name) {
    +    $output .= drupal_render($form['palette'][$name]);
    +  }
    +  $output .= '</div>';
    +  // Preview.
    +  $output .= drupal_render_children($form);
    +  $output .= '<h2>' . t('Preview') . '</h2>';
    

    I'm curious why we're adding HTML back into preprocess. This should be left in the twig template. Also, this has nothing to do with coding standards and is changing logic/output.

  3. +++ b/core/modules/color/css/color.admin.css
    @@ -10,8 +10,8 @@
    +  top: 0;
    
    @@ -22,16 +22,16 @@
    +  padding-left: 1em; /* LTR */
    ...
    +  float: left; /* LTR */
    
    @@ -47,9 +47,9 @@
    +  margin-right: 5px; /* LTR */
    +  text-align: center;
    
    @@ -57,9 +57,9 @@
    +  height: 16px;
    
    @@ -87,14 +87,15 @@
    +  cursor: pointer;
    ...
    +  height: 25px;
    +  left: -10px; /* LTR */
    
    @@ -116,8 +117,8 @@
    +  position: relative;
    

    This is one of my personal pet peeves :) CSS properties should always be alphabetized! Thank you very much for this! It makes me very happy :)

  4. +++ b/core/modules/color/css/color.admin.css
    @@ -87,14 +87,15 @@
    +  background: url(images/lock.png) no-repeat 50% 2px;
    ...
       background: url(../images/lock.png) no-repeat 50% 2px;
    

    Looks like you forgot to remove the background at the bottom when you moved it. Also, is there a reason for removing ../?

sphism’s picture

- * @param array $variables
+ * @param Array $variables

I've not reviewed this but I'm pretty sure it's array with a lower case a.

Does coder suggest Array ?

markhalliwell’s picture

Ah, great catch! I completely missed that. Yes it should be array, no capitalization. (@see: https://drupal.org/coding-standards/docs#types)

mikemiles86’s picture

Assigned: Unassigned » mikemiles86
Issue summary: View changes
mikemiles86’s picture

Assigned: mikemiles86 » Unassigned

not able to work on this, I'm having issues getting coder to work in D8.

chrisfromredfin’s picture

Status: Needs work » Needs review
StatusFileSize
new8.02 KB

This patch is a re-roll of the most recent patch plus the additional feedback since then.

Status: Needs review » Needs work

The last submitted patch, 18: 1530724-color_pass_coder-18.patch, failed testing.

deepakaryan1988’s picture

Assigned: Unassigned » deepakaryan1988
deepakaryan1988’s picture

Status: Needs work » Needs review
StatusFileSize
new5.22 KB

I have created patch for this.

Status: Needs review » Needs work

The last submitted patch, 21: 1530724-color_pass_coder-21.patch, failed testing.

falc0’s picture

+++ b/core/modules/color/color.module
@@ -12,13 +12,13 @@
+      $output .= '<p>' . t("The Color module allows users with the <em>Administer site configuration</em> permission to change the color scheme (color of links, backgrounds, text, and other theme elements) of themes that are compatible with it. For more information, see <a href="!color_do">the online documentation for the Color module</a>.", array('!color_do' => 'https://drupal.org/documentation/modules/color')) . '</p>';

should be in single quotes like this:

+++ b/core/modules/color/color.module
@@ -12,13 +12,13 @@
+      $output .= '<p>' . t('The Color module allows users with the <em>Administer site configuration</em> permission to change the color scheme (color of links, backgrounds, text, and other theme elements) of themes that are compatible with it. For more information, see <a href="!color_do">the online documentation for the Color module</a>.', array('!color_do' => 'https://drupal.org/documentation/modules/color')) . '</p>';
ThisIsDog’s picture

StatusFileSize
new4.8 KB

I attempted to fix the syntax error on line 16 for the translation function.

ThisIsDog’s picture

Status: Needs work » Needs review
deepakaryan1988’s picture

@ThisisDog #24 This patch seems good to me. Can anyone have a look on this.

markhalliwell’s picture

Assigned: deepakaryan1988 » Unassigned
Status: Needs review » Needs work

The CSS and Test changes were lost from #18 -> #21 with no explanation as to why.

visabhishek’s picture

Assigned: Unassigned » visabhishek
Status: Needs work » Needs review
StatusFileSize
new5.56 KB

I have Created a patch. Please review

linl’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies, tagging for reroll.

visabhishek’s picture

Status: Needs work » Needs review
StatusFileSize
new5.35 KB

simply reroll...

markhalliwell’s picture

Status: Needs review » Needs work

Now the color.module and CSS changes have been lost. Please see the patch in #18.

sriharsha.uppuluri’s picture

Status: Needs work » Needs review
StatusFileSize
new6.98 KB
new1.54 KB

Updated the patch with css

markhalliwell’s picture

Assigned: visabhishek » Unassigned
Status: Needs review » Needs work
Issue tags: -Needs reroll

This still doesn't include the changes to color.module in #18.

visabhishek’s picture

Status: Needs work » Needs review
StatusFileSize
new3.31 KB
new10.38 KB

i am merging the changes from color.module in #18

cs_shadow’s picture

Status: Needs review » Needs work

Following errors remain after applying the patch in #34.

FILE: /var/www/html/drupal8/core/modules/color/color.install
--------------------------------------------------------------------------------
FOUND 4 ERROR(S) AFFECTING 4 LINE(S)
--------------------------------------------------------------------------------
 25 | ERROR | Do not use t() or st() in installation phase hooks, use $t =
    |       | get_t() to retrieve the appropriate localization function name
 30 | ERROR | Do not use t() or st() in installation phase hooks, use $t =
    |       | get_t() to retrieve the appropriate localization function name
 32 | ERROR | Do not use t() or st() in installation phase hooks, use $t =
    |       | get_t() to retrieve the appropriate localization function name
 35 | ERROR | Do not use t() or st() in installation phase hooks, use $t =
    |       | get_t() to retrieve the appropriate localization function name
--------------------------------------------------------------------------------


FILE: /var/www/html/drupal8/core/modules/color/color.module
--------------------------------------------------------------------------------
FOUND 1 ERROR(S) AND 1 WARNING(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
  22 | WARNING | Avoid backslash escaping in translatable strings when
     |         | possible, use "" quotes instead
 159 | ERROR   | Invalid @param data type, expected string but found String
--------------------------------------------------------------------------------
cs_shadow’s picture

Fixing the errors in #35.

cs_shadow’s picture

Status: Needs work » Needs review
markhalliwell’s picture

Status: Needs review » Needs work

Thanks @cs_shadow!

One final smaller nit pick:

+++ b/core/modules/color/color.install
@@ -22,17 +22,17 @@ function color_requirements($phase) {
+        $requirements['color_gd']['description'] = get_t('The GD library for PHP is enabled, but was compiled without PNG support. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/ref.image.php'));
...
+        'value' => get_t('Not installed'),
...
+        'description' => get_t('The GD library for PHP is missing or outdated. Check the <a href="@url">PHP image documentation</a> for information on how to correct this.', array('@url' => 'http://www.php.net/manual/book.image.php')),
...
+    $requirements['color_gd']['title'] = get_t('GD library PNG support');

We rarely use get_t() directly (unless it's the only one instance of it in the function). However we have four calls to the function, it would be better to assign it to the $t variable and then reference it like $t('...'). This just helps avoid unnecessary PHP calls; granted not making much of a difference performance wise, but it falls in line with our coding standards.

cs_shadow’s picture

Status: Needs work » Needs review
StatusFileSize
new12.33 KB
new1.9 KB

Attaching patch with changes as suggested in #38.

Status: Needs review » Needs work

The last submitted patch, 39: color.module-pass_coder_review-1530724-39.patch, failed testing.

cs_shadow’s picture

The last submitted patch, 39: color.module-pass_coder_review-1530724-39.patch, failed testing.

The last submitted patch, 39: color.module-pass_coder_review-1530724-39.patch, failed testing.

markhalliwell’s picture

Doh, forgot get_t() was removed in 8.x: https://drupal.org/node/2021435

cs_shadow’s picture

Status: Needs work » Needs review
StatusFileSize
new10.38 KB

Replacing calls to get_t() by t() simply. I got carried away with the codesniffer suggestions. Should work now.

markhalliwell’s picture

I know https://drupal.org/project/coder has a 8.x version, if you were using the latest dev and that reported the get_t() solution, a follow-up issue should probably be created in it's issue queue.

cs_shadow’s picture

I wasn't using 'Coder' module but command line 'drush dcs'. I'll check if there's an update for that.

By the way RTBC?

markhalliwell’s picture

Yes. From a code standpoint, this looks good. I'll need to manually test this though to ensure everything has been addressed. Give me just a second.

markhalliwell’s picture

Status: Needs review » Reviewed & tested by the community
markcarver@Marks-MacBook-Air$ drush coder --minor core/modules/color/color.module core/modules/color
Severity minor, Drupal Coding Standards

/Users/markcarver/Sites/d8.sandbox/core/modules/color/color.module:
 No Problems Found

/Users/markcarver/Sites/d8.sandbox/core/modules/color/color.install:
 No Problems Found

/Users/markcarver/Sites/d8.sandbox/core/modules/color/lib/Drupal/color/Tests/ColorTest.php:
 No Problems Found

/Users/markcarver/Sites/d8.sandbox/core/modules/color/tests/modules/color_test/themes/color_test_theme/color/color.inc:
 No Problems Found

Coder found 4 projects, 4 files, 0 warnings were flagged to be ignored                                                                                                         [status]



markcarver@Marks-MacBook-Air$ drush coder --minor --sniffer core/modules/color/color.module core/modules/color
Severity minor, Drupal CodeSniffer

/Users/markcarver/Sites/d8.sandbox/core/modules/color/color.module:
 No Problems Found

/Users/markcarver/Sites/d8.sandbox/core/modules/color/color.install:
 No Problems Found

/Users/markcarver/Sites/d8.sandbox/core/modules/color/lib/Drupal/color/Tests/ColorTest.php:
 No Problems Found

/Users/markcarver/Sites/d8.sandbox/core/modules/color/tests/modules/color_test/themes/color_test_theme/color/color.inc:
 No Problems Found

PHP/CodeSniffer.php not found                                                                                                                                                  [status]
Coder found 4 projects, 4 files, 0 warnings were flagged to be ignored                                                                                                         [status]
alexpott’s picture

Status: Reviewed & tested by the community » Needs work
  1. +++ b/core/modules/color/color.module
    @@ -247,9 +247,7 @@ function color_scheme_form($complete_form, &$form_state, $theme) {
    - * Prepares variables for color scheme form templates.
    - *
    - * Default template: color-scheme-form.html.twig.
    

    This is a standard the twig team has introdcued

  2. +++ b/core/modules/color/css/color.admin.css
    @@ -4,33 +4,46 @@
     .color-form {
       max-width: 50em;
    +  position: relative;
    +}
    +#placeholder {
    +  position: absolute;
    +  right: 0; /* LTR */
    +  top: 0;
     }
     .farbtastic {
       margin: 0 auto;
     }
     .color-form .form-item {
    -  overflow: hidden;
    +  height: 2em;
    +  line-height: 2em;
       margin: 0.5em 0;
    +  overflow: hidden;
    +  padding-left: 1em; /* LTR */
     }
     .color-form label {
       clear: left; /* LTR */
    +  float: left; /* LTR */
    +  width: 10em;
     }
     [dir="rtl"] .color-form label {
       clear: right;
     }
     .color-form .form-text {
    +  cursor: pointer;
       float: left; /* LTR */
    -  width: 86%;
    +  margin-right: 5px; /* LTR */
       text-align: center;
    -  cursor: pointer;
    +  width: 86%;
     }
     [dir="rtl"] .color-form .form-text {
       float: right;
     }
     #palette .hook {
       float: left; /* LTR */
    -  width: 16px;
       height: 16px;
    +  margin-top: 3px;
    +  width: 16px;
     }
    

    These css changes appear to be going beyond a coder review?

+++ b/core/modules/color/lib/Drupal/color/Tests/ColorTest.php
@@ -56,11 +59,11 @@ public static function getInfo() {
+    $this->bigUser = $this->drupalCreateUser(array('administer themes'));

Why keep calling this bigUser? Like to do we mean fat?

cs_shadow’s picture

Status: Needs work » Needs review
StatusFileSize
new8.41 KB
new1.94 KB

Attaching patch that fixes the issues 1 & 2 mentioned in #50. Reg. bigUser, shouldn't we address it as part of another issue. Though IMO 'bigUser' should be replaced by something like 'adminUser'.

alexpott’s picture

@cs_shadow I'm happy for the css to be alphabetised - it just appears that there are changes too.

cs_shadow’s picture

Alphabetised the css without changing any properties. Attached patch and interdiff.

The last submitted patch, 51: color.module-pass_coder_review-1530724-51.patch, failed testing.

linl’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies, tagging for reroll.

rajendar reddy’s picture

patch reroll...

rajendar reddy’s picture

Status: Needs work » Needs review
Jalandhar’s picture

Status: Needs review » Needs work

Patch #56 no longer applies. It needs to be re-rolled.

oriol_e9g’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new8.6 KB

Reroll

jazio’s picture

+++ b/core/modules/color/css/color.admin.css
@@ -86,13 +86,13 @@
   .color-form label {
-    float: left; /* LTR */
     clear: left; /* LTR */
+    float: left; /* LTR */    ¶
     width: 15em;
   }
   [dir="rtl"] .color-form label {
-    float: right;
     clear: right;
+    float: right;    ¶
   }
   .color-form .form-text,
   .color-form .form-select {
@@ -127,8 +127,8 @@

@@ -127,8 +127,8 @@
 }
 .js #preview {
   display: block;
-  position: relative;
   float: left; /* LTR */
+  position: relative;  ¶
 }
 .js[dir="rtl"] #preview {
   float: right;
@@ -136,7 +136,7 @@

@@ -136,7 +136,7 @@
 @media screen and (max-width: 30em) { /* 480px */
   .color-form #preview-sidebar,
   .color-form #preview-content {
-    width: auto;
     margin: 0;
+    width: auto;    ¶
   }

Please fix whitepaces.

jazio’s picture

Status: Needs review » Needs work
revagomes’s picture

StatusFileSize
new8.58 KB

Rerolling with the whitespace fix.

revagomes’s picture

Status: Needs work » Needs review
blattmann’s picture

Issue tags: +Amsterdam2014

Reviewing this issue.

blattmann’s picture

I've reviewed #62 manually for coding standards and things look good to me.

blattmann’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 62: color-module-color-review-1530724-62.patch, failed testing.

xjm’s picture

Version: 8.0.x-dev » 8.1.x-dev
Priority: Normal » Minor
Status: Needs work » Postponed
Issue tags: -Novice

Thanks for all the work here so far. See #1518116-86: [meta] Make Core pass Coder Review. This issue is postponed until the meta issue is either closed or reopened.

pfrenssen’s picture

Status: Postponed » Closed (duplicate)

Closing in favor of #2571965: [meta] Fix PHP coding standards in core, stage 1. In this issue the coding standards will be fixed on a sniff-per-sniff basis rather than a module-per-module basis.