Problem/Motivation

On some occasions, running phpcbf with the "Drupal" and "Drupal-Practice" coding rulesets, "min.css" files will get formatted. Since these files are intended to be compressed and should never be optimized, we have to exclude them from the "Drupal" ruleset.

It seems that this is not always the case, but excluding them directly in the ruleset, will fix the issue.

Steps to reproduce

  • Create a custom module
  • Create a css/admin folder
  • Create a "mymodule_paragraphs.paragraphs_ui.min.css" file inside the "mymodule/css/admin" folder
  • Run "phpcbf --standard=Drupal,DrupalPractice web/modules/custom/mymodule"

Proposed resolution

Exclude all "min.css" files in the ruleset.

Issue fork coder-3269399

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Grevil created an issue. See original summary.

grevil’s picture

Status: Active » Needs review

I created a merge request, fixing the issue.

thomas.frobieter’s picture

Status: Needs review » Reviewed & tested by the community

Patch looks fine to me!

anybody’s picture

Shouldn't it better be *.min.css? (with a dot)?

Otherwise wouldn't admin.css be excluded? ;)

anybody’s picture

Status: Reviewed & tested by the community » Needs work
anybody’s picture

Interestingly the code check on Drupal CI also checks minified css files, which also doesn't make much sense to me, see for example: https://www.drupal.org/pift-ci-job/2339610 - I didn't find an issue for that.

anybody’s picture

Title: Exclude "min.css" files from the Drupal ruleset » Exclude ".min.css" files from the Drupal ruleset
grevil’s picture

Status: Needs work » Needs review

Thanks, @Anybody, didn't think of that!

I fixed it on Gitlab and https://github.com/pfrenssen/coder/pull/159.

  • 0cfad3a committed on 8.3.x
    feat(ruleset): Exclude ".min.css" files from the Drupal ruleset (#...
klausi’s picture

Status: Needs review » Fixed

Merged, thanks!

Status: Fixed » Closed (fixed)

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