Page MenuHomePhabricator

Jenkins doesn't have CSS-specific whitepsace rules regarding parentheses
Closed, DeclinedPublicBUG REPORT

Description

CSS should probably be formatted like this:

.cargo-pagevalues-row:nth-of-type(2n) {
    background-color: var(--cargo-pv-zebra-color);
}

.cargo-pagevalues-row:hover {
    background-image: linear-gradient(var(--cargo-pv-highlight-color), var(--cargo-pv-highlight-color));
}

but the linter errors on that and requests spaces around all of the content inside of the parentheses, as if it were php, like this (which is really nonstandard for css):

.cargo-pagevalues-row:nth-of-type( 2n ) {
    background-color: var( --cargo-pv-zebra-color );
}

.cargo-pagevalues-row:hover {
    background-image: linear-gradient( var( --cargo-pv-highlight-color ), var( --cargo-pv-highlight-color ) );
}

For example in this report: https://integration.wikimedia.org/ci/job/mwgate-node14-docker/16152/console

00:01:23.780 Running "stylelint:all" (stylelint) task
00:01:25.080 
00:01:25.080 resources/CargoPageValues.css
00:01:25.080   2:25  ✖  Expected single space after ":"            declaration-colon-space-after                 
00:01:25.080   3:35  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080   3:46  ✖  Expected single space after ","            function-comma-space-after                    
00:01:25.080   3:49  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080   9:24  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080   9:54  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080  12:31  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080  12:63  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080  61:35  ✖  Expected single space after "("            selector-pseudo-class-parentheses-space-inside
00:01:25.080  61:36  ✖  Expected single space before ")"           selector-pseudo-class-parentheses-space-inside
00:01:25.080  62:24  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080  62:45  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080  66:19  ✖  Expected single space after ":"            declaration-colon-space-after                 
00:01:25.080  66:35  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080  66:39  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080  66:64  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080  66:66  ✖  Expected single space after ","            function-comma-space-after                    
00:01:25.080  66:71  ✖  Expected single space after "("            function-parentheses-space-inside             
00:01:25.080  66:96  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080  66:97  ✖  Expected single space before ")"           function-parentheses-space-inside             
00:01:25.080  70:10  ✖  Expected single space after ":"            declaration-colon-space-after                 
00:01:25.080  71:9   ✖  Expected single space after ":"            declaration-colon-space-after                 
00:01:25.080  72:1   ✖  Unexpected missing end-of-source newline   no-missing-end-of-source-newline
00:01:25.080 
00:01:25.080 
00:01:25.081 ⚠ 23 warnings
00:01:25.081 
00:01:25.082 Warning: Task "stylelint:all" failed. Use --force to continue.
00:01:25.082

Event Timeline

hashar edited projects, added ci-test-error; removed Gerrit.
hashar subscribed.

The CSS lint failures come from stylelint. The configuration enforces the conventions at https://www.mediawiki.org/wiki/Manual:Coding_conventions/CSS and it is implemented in the stylelint-config-wikimedia package. We do indeed request extra spaces after opening parenthesis and before closing parenthesis:

we love whitespaces:

One space after a starting and before an ending parentheses (( and )) in selectors (ex. :not()) and properties (ex. rgba()).

For reference:

Our stylelint config is maintained at https://github.com/wikimedia/stylelint-config-wikimedia

The Cargo extension has an update pending:

$ npm outdated
Package                     Current  Wanted  Latest  Location                                 Depended by
grunt-eslint                 23.0.0  23.0.0  24.0.0  node_modules/grunt-eslint                Cargo
grunt-stylelint              0.16.0  0.16.0  0.18.0  node_modules/grunt-stylelint             Cargo
stylelint-config-wikimedia   0.11.1  0.11.1  0.12.2  node_modules/stylelint-config-wikimedia  Cargo

Then we have the LibUp system which will eventually update it automatically at some point.