Problem/Motivation

Bah, we can't update stylelint because of stylelint-formatter-gitlab: https://gitlab.com/leon0399/stylelint-formatter-gitlab/-/issues/3

@longwave in #3439522-16: Update JavaScript dependencies for Drupal 10.3/11.0

Looks like stylelint-formatter-gitlab might be abandoned, at the very least it doesn't work with this change in styleint 16: stylelint-formatter-gitlab.

There seems to be a workaround here: https://gitlab.com/leon0399/stylelint-formatter-gitlab/-/issues/3#note_1..., but that seems to involve running stuff twice, which seems not great.
There's also a non-passing MR here: https://gitlab.com/leon0399/stylelint-formatter-gitlab/-/merge_requests/3

TLDR: We are currently held back in updating stylelint due to lack of nicely formatted gitlab code-quality reports.
I think it's undesirable to be held back in updating dependencies because tooling lags behind.

With not having had any commit since Sep 25, 2022, and no response from a/the maintainer on the MR mentioned above. I think it's safe to say: Not gonna happen, abandoned.

Steps to reproduce

Proposed resolution

https://gitlab.com/gitlab-formatters/stylelint-formatter-gitlab which works with "stylelint": ">=14"

Remaining tasks

Backport this to the gazillion current branches, TBD by the core committers.

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3467309

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

Spokje created an issue. See original summary.

spokje’s picture

Assigned: Unassigned » spokje

With the upcoming releases of 10.4.0 and 11.1.0 this issue is as hot as ever.

spokje’s picture

Issue summary: View changes
spokje’s picture

Title: stylelint-formatter-gitlab prevents updating stylelint » Replace abandoned, not working with latest styleint, leon0399/stylelint-formatter-gitlab with gitlab-formatters/stylelint-formatter-gitlab
Issue summary: View changes
spokje’s picture

Title: Replace abandoned, not working with latest styleint, leon0399/stylelint-formatter-gitlab with gitlab-formatters/stylelint-formatter-gitlab » Replace abandoned, not working with latest stylelint, leon0399/stylelint-formatter-gitlab with gitlab-formatters/stylelint-formatter-gitlab

spokje’s picture

Assigned: spokje » Unassigned
Status: Active » Needs review
spokje’s picture

MR !10129 shows that when there are no errors, stuff doesn't break.

This run of another issue show that it can actually detect and report issues: https://git.drupalcode.org/issue/drupal-3487817/-/pipelines/340184/codeq...

That report does indeed look like the example report given here: https://gitlab.com/gitlab-formatters/stylelint-formatter-gitlab/-/merge_...

spokje’s picture

Priority: Normal » Critical
Issue summary: View changes

Mirroring status of parent issue, which became critical.

spokje’s picture

Issue tags: +blocker
smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

So the output is slightly different now but I think for the better

before

  <file name="/var/www/html/web/core/misc/dialog/off-canvas/css/titlebar.pcss.css"></file>
  <file name="/var/www/html/web/core/misc/dialog/off-canvas/css/utility.css"></file>
  <file name="/var/www/html/web/core/misc/dialog/off-canvas/css/utility.pcss.css"></file>
  <file name="/var/www/html/web/core/misc/dialog/off-canvas/css/wrapper.css"></file>
  <file name="/var/www/html/web/core/misc/dialog/off-canvas/css/wrapper.pcss.css"></file>
  <file name="/var/www/html/web/core/themes/claro/css/base/elements.css"></file>
  <file name="/var/www/html/web/core/themes/claro/css/base/elements.pcss.css">
    <error source="stylelint.rules.order/properties-order" line="7" column="3" severity="error" message="Expected &quot;font-family&quot; to come before &quot;font-style&quot; (order/properties-order)" />
  </file>
  <file name="/var/www/html/web/core/themes/claro/css/base/print.css"></file>
  <file name="/var/www/html/web/core/themes/claro/css/base/print.pcss.css"></file>

After

> lint:css-checkstyle
> stylelint "**/*.css" --custom-formatter=@gitlab-formatters/stylelint-formatter-gitlab --output-file=gl-codequality.json

[{"type":"issue","check_name":"order/properties-order","description":"Expected \"font-family\" to come before \"line-height\" (order/properties-order)","content":{"body":"Error found in order/properties-order."},"categories":["Style"],"location":{"path":"themes/claro/css/base/elements.pcss.css","lines":{"begin":7,"end":7},"positions":{"begin":{"line":7,"column":3},"end":{"line":7,"column":35}}},"s

But more importantly it found the error I introduced.

spokje’s picture

IMHO the output on GitLab is what matters, the grimy internal format to get there is less relevant.
The output on GitLab is advertised in its own repo as looking something like this:
Screenshot from repo

And in our own drupal CSS Linting job: https://git.drupalcode.org/issue/drupal-3487817/-/pipelines/340184/codeq...

  • longwave committed 832c37ff on 11.1.x
    Issue #3467309 by spokje, smustgrave: Replace abandoned, not working...

  • longwave committed 7778818b on 11.x
    Issue #3467309 by spokje, smustgrave: Replace abandoned, not working...
longwave’s picture

Version: 11.x-dev » 10.5.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

In the interests of unblocking the Stylelint upgrade let's get this in now. I think the output could be improved - we should fix up the paths so the link in https://git.drupalcode.org/issue/drupal-3487817/-/pipelines/340184/codeq... is clickable - but that can happen in a followup.

Committed and pushed to 11.x and 11.1.x, thanks! Marking PTBP for backport to 10.5.x and 10.4.x.

spokje changed the visibility of the branch 11.x to hidden.

spokje changed the visibility of the branch 3467309-stylelint-formatter-gitlab-prevents-updating to hidden.

spokje’s picture

Status: Patch (to be ported) » Needs review
sourav_paul’s picture

working on to port changes into 10.4.x

sourav_paul’s picture

Version: 10.5.x-dev » 10.4.x-dev

sourav_paul changed the visibility of the branch 11.x to active.

sourav_paul changed the visibility of the branch 11.x to hidden.

smustgrave’s picture

Version: 10.4.x-dev » 10.5.x-dev
Status: Needs review » Reviewed & tested by the community

Re-rolls seem fine.

longwave’s picture

Version: 10.5.x-dev » 10.4.x-dev
Status: Reviewed & tested by the community » Fixed

@sourav_paul the 10.5.x patch applies fine to 10.4.x, there was no need to open a separate MR.

Committed and pushed 07aa9ecb2f7 to 10.5.x and 4079ec4a177 to 10.4.x. Thanks!

  • longwave committed 4079ec4a on 10.4.x
    Issue #3467309 by spokje, smustgrave: Replace abandoned, not working...

  • longwave committed 07aa9ecb on 10.5.x
    Issue #3467309 by spokje, smustgrave: Replace abandoned, not working...

Status: Fixed » Closed (fixed)

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