It would be nice to allow site owners to selectively ignore (whitelist) certain CSS or JS warnings/errors.

Comments

emmonsaz’s picture

StatusFileSize
new5.88 KB
new58.59 KB
new20.04 KB
new25.28 KB
new20.51 KB

See attached for a suggested patch. Here are my settings.php entries:

$conf['csslint_ignore'] = 'ids,important';
$conf['jshint_ignore'] = 'E007'; 

I didn't add a config option via the Drupal admin UI but it would be fairly easy to implement if you wanted.

emmonsaz’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 1: advagg_validator-ignore_rules-2492481-1.patch, failed testing.

mikeytown2’s picture

This is a great idea! If you could re-roll the patch so it applies to the latest dev and use 2 spaces in place of tabs that would be nice https://www.drupal.org/coding-standards#indenting

The variables should be prefixed with advagg. The GUI can be a followup :)

emmonsaz’s picture

Re-rolled...

P.S. I also tweaked the JS error output to match the CSS output.

emmonsaz’s picture

Status: Needs work » Needs review
emmonsaz’s picture

Here are the new settings.php settings I used:

$conf['advagg_csslint_ignore'] = 'ids,important';
$conf['advagg_jshint_ignore'] = 'E007'; 

Status: Needs review » Needs work

The last submitted patch, 5: advagg_validator-ignore_rules-2492481-5.patch, failed testing.

mikeytown2’s picture

Assigned: Unassigned » mikeytown2

I'll take it from here and get a patch up.

mikeytown2’s picture

Assigned: mikeytown2 » Unassigned
Status: Needs work » Needs review
StatusFileSize
new6.9 KB
mikeytown2’s picture

Test passes. I changed the variable name prefix to advagg_validator and made them be able to accept a string or an array; also defined a default value of an empty string.

Anything else to add?

emmonsaz’s picture

Thanks, looks good! I'm still figuring out the Drupal patch process (obviously) :)

  • mikeytown2 committed 1375459 on 7.x-2.x authored by emmonsaz
    Issue #2492481 by emmonsaz, mikeytown2: Ignore specific js and css rules...
mikeytown2’s picture

Status: Needs review » Fixed

Thanks for the work on this. Patch in #10 has been committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

emmonsaz’s picture