- 🇩🇪Germany sleitner
In GitLab CI css is not tested with phpcs anymore, stylelint is used in GitLab CI.
https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/scripts/phpcs.xml.dist
Recently I was reviewing an issue and noticed that PHPCS throws an error if @CHARSET "UTF-8"; is declared on its own line. This same applies to other CSS At-rule.
In a CSS file below code is being used and PHPCS throws an error.
File: modules/contrib/autocomplete_deluxe/assets/css/autocomplete_deluxe.css
@CHARSET "UTF-8";
ul.ui-autocomplete {
max-height: 240px;
overflow-x: hidden;
overflow-y: scroll;
padding: 3px;
}
❯ autocomplete_deluxe 8.x-1.x* phpcs --standard=Drupal .
FILE: modules/contrib/autocomplete_deluxe/assets/css/autocomplete_deluxe.css
--------------------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Selectors must be on a single line
2 | ERROR | [x] Blank lines are not allowed between class names
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------
Time: 405ms; Memory: 10Mb
This is allowed:
@CHARSET "UTF-8"; ul.ui-autocomplete {
max-height: 240px;
overflow-x: hidden;
overflow-y: scroll;
padding: 3px;
}
Allow At-rules to be on its own line.
- Discussion
- Write a patch
- Commit
Closed: outdated
3.0
Coder Sniffer
It involves compliance with, or the content of coding standards. Requires broad community agreement.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
In GitLab CI css is not tested with phpcs anymore, stylelint is used in GitLab CI.
https://git.drupalcode.org/project/gitlab_templates/-/blob/1.0.x/scripts/phpcs.xml.dist