Skip to content
Snippets Groups Projects
Commit c847bce7 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by David Siegfried
Browse files

add css linting for css, less and scss, re #606

Merge request studip/studip!724
parent f4a9db3e
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
composer composer
node_modules node_modules
nbproject nbproject
.phplint-cache .caches/*
.reports/*
config/config_local.inc.php config/config_local.inc.php
config/config.inc.php config/config.inc.php
......
...@@ -37,61 +37,93 @@ stages: ...@@ -37,61 +37,93 @@ stages:
- sed -i "s%$PWD/%%" tests/_output/report.xml - sed -i "s%$PWD/%%" tests/_output/report.xml
.artifacts: .artifacts:
common: &common common: &common-artifacts
when: always when: always
expire_in: 1 week expire_in: 1 week
tests: &test-artifacts tests: &test-artifacts
<<: *common <<: *common-artifacts
paths: paths:
- tests/_output - tests/_output
reports: reports:
junit: tests/_output/report.xml junit: tests/_output/report.xml
.caches: .caches:
php: &php-cache php: &composer-cache
key: "php-$CI_COMMIT_REF_SLUG" key: "php-$CI_COMMIT_REF_SLUG"
paths: paths:
- composer/ - composer/
- .phplint-cache - .caches/phplint-cache
js: &js-cache js: &npm-cache
key: "js-$CI_COMMIT_REF_SLUG" key: "js-$CI_COMMIT_REF_SLUG"
paths: paths:
- node_modules/ - node_modules/
- .eslintcache - .caches/eslint-cache
- .caches/stylelint-cache
lint-php: lint-php:
stage: checks stage: checks
needs: [] needs: []
cache: *php-cache cache: *composer-cache
allow_failure: false allow_failure: false
interruptible: true interruptible: true
before_script: before_script:
- !reference [.scripts, install-composer] - !reference [.scripts, install-composer]
- mkdir -p .reports
script: script:
- php -d memory_limit=-1 composer/bin/phplint --xml report.xml - php -d memory_limit=-1 composer/bin/phplint --xml .reports/phplint-report.xml --cache=.caches/phplint-cache
artifacts: artifacts:
<<: *common <<: *common-artifacts
paths: paths:
- report.xml - .reports/phplint-report.xml
reports: reports:
junit: report.xml junit: .reports/phplint-report.xml
lint-js: lint-js:
stage: checks stage: checks
needs: [] needs: []
cache: *js-cache cache: *npm-cache
allow_failure: false allow_failure: false
interruptible: true interruptible: true
before_script: before_script:
- make npm - make npm
script: script:
- npm run lint -- --cache - npm run lint -- --cache --cache-location .caches/eslint-cache --format ./node_modules/eslint-junit/index.js
only:
changes:
- resources/assets/javascripts/**/*
- resources/vue/**/*
artifacts:
<<: *common-artifacts
paths:
- .reports/eslint-report.xml
reports:
junit: .reports/eslint-report.xml
lint-css:
stage: checks
needs: []
cache: *npm-cache
allow_failure: false
interruptible: true
before_script:
- make npm
script:
- npm run css-lint -s -- --cache --cache-location .caches/stylelint-cache --custom-formatter node_modules/stylelint-junit-formatter --output-file .reports/stylelint-report.xml
only:
changes:
- resources/assets/stylesheets/**/*
artifacts:
<<: *common-artifacts
paths:
- .reports/stylelint-report.xml
reports:
junit: .reports/stylelint-report.xml
test-unit: test-unit:
stage: tests stage: tests
needs: [lint-php] needs: [lint-php]
cache: cache:
<<: *php-cache <<: *composer-cache
policy: pull policy: pull
allow_failure: false allow_failure: false
interruptible: true interruptible: true
...@@ -107,7 +139,7 @@ test-functional: ...@@ -107,7 +139,7 @@ test-functional:
stage: tests stage: tests
needs: [lint-php] needs: [lint-php]
cache: cache:
<<: *php-cache <<: *composer-cache
policy: pull policy: pull
services: services:
- mariadb - mariadb
...@@ -125,7 +157,7 @@ test-jsonapi: ...@@ -125,7 +157,7 @@ test-jsonapi:
stage: tests stage: tests
needs: [lint-php] needs: [lint-php]
cache: cache:
<<: *php-cache <<: *composer-cache
policy: pull policy: pull
services: services:
- mariadb - mariadb
......
path: ./ path: ./
jobs: 10 jobs: 10
cache: .phplint-cache cache: .caches/phplint-cache
extensions: extensions:
- php - php
exclude: exclude:
- vendor
- composer - composer
- public/plugins_packages
- vendor
{
"extends": "stylelint-config-standard",
"rules": {
"alpha-value-notation": null,
"at-rule-empty-line-before": null,
"at-rule-no-vendor-prefix": null,
"block-closing-brace-empty-line-before": null,
"block-closing-brace-newline-after": null,
"block-closing-brace-newline-before": null,
"block-closing-brace-space-before": null,
"block-no-empty": null,
"block-opening-brace-newline-after": null,
"block-opening-brace-space-after": null,
"block-opening-brace-space-before": null,
"color-function-notation": null,
"color-hex-case": null,
"color-hex-length": null,
"color-no-invalid-hex": null,
"comment-empty-line-before": null,
"comment-whitespace-inside": null,
"declaration-bang-space-after": null,
"declaration-bang-space-before": null,
"declaration-block-no-duplicate-properties": null,
"declaration-block-no-redundant-longhand-properties": null,
"declaration-block-no-shorthand-property-overrides": null,
"declaration-block-semicolon-newline-after": null,
"declaration-block-semicolon-space-before": null,
"declaration-block-single-line-max-declarations": null,
"declaration-block-trailing-semicolon": null,
"declaration-colon-newline-after": null,
"declaration-colon-space-after": null,
"declaration-colon-space-before": null,
"declaration-empty-line-before": null,
"font-family-name-quotes": null,
"font-family-no-missing-generic-family-keyword": null,
"function-comma-space-after": null,
"function-comma-space-before": null,
"function-name-case": null,
"function-no-unknown": null,
"function-parentheses-newline-inside": null,
"function-parentheses-space-inside": null,
"function-url-quotes": null,
"hue-degree-notation": null,
"indentation": null,
"keyframes-name-pattern": null,
"length-zero-no-unit": null,
"max-empty-lines": null,
"max-line-length": null,
"media-feature-name-no-vendor-prefix": null,
"no-descending-specificity": null,
"no-duplicate-selectors": null,
"no-empty-first-line": null,
"no-empty-source": null,
"no-eol-whitespace": null,
"no-extra-semicolons": null,
"no-invalid-position-at-import-rule": null,
"no-irregular-whitespace": null,
"no-missing-end-of-source-newline": null,
"number-leading-zero": null,
"number-max-precision": null,
"number-no-trailing-zeros": null,
"property-no-vendor-prefix": null,
"rule-empty-line-before": null,
"selector-attribute-quotes": null,
"selector-class-pattern": null,
"selector-combinator-space-after": null,
"selector-combinator-space-before": null,
"selector-descendant-combinator-no-non-space": null,
"selector-id-pattern": null,
"selector-list-comma-newline-after": null,
"selector-no-vendor-prefix": null,
"selector-not-notation": null,
"selector-pseudo-element-colon-notation": null,
"shorthand-property-no-redundant-values": null,
"string-quotes": null,
"value-keyword-case": null,
"value-list-max-empty-lines": null,
"value-no-vendor-prefix": null
},
"overrides": [
{
"files": ["**/*.scss"],
"customSyntax": "postcss-scss",
"rules": {
"at-rule-no-unknown": null
}
},
{
"files": ["**/*.less"],
"customSyntax": "postcss-less"
}
],
"ignoreFiles": [
"resource/assets/stylesheets/jquery-ui.structure.css",
"resources/assets/stylesheets/less/jquery-ui/*",
"resources/assets/stylesheets/vendor/*"
]
}
This diff is collapsed.
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
"private": true, "private": true,
"scripts": { "scripts": {
"lint": "eslint resources/assets/javascripts resources/vue", "lint": "eslint resources/assets/javascripts resources/vue",
"css-lint": "stylelint resources/assets/stylesheets",
"wds": "webpack serve --progress --config webpack.dev-server.js", "wds": "webpack serve --progress --config webpack.dev-server.js",
"webpack-dev": "webpack --config webpack.dev.js --mode development", "webpack-dev": "webpack --config webpack.dev.js --mode development",
"webpack-prod": "webpack --config webpack.prod.js --mode production", "webpack-prod": "webpack --config webpack.prod.js --mode production",
...@@ -48,6 +49,7 @@ ...@@ -48,6 +49,7 @@
"easygettext": "^2.17.0", "easygettext": "^2.17.0",
"es6-promise": "4.2.8", "es6-promise": "4.2.8",
"eslint": "^7.32.0", "eslint": "^7.32.0",
"eslint-junit": "^1.0.1",
"eslint-plugin-vue": "7.7.0", "eslint-plugin-vue": "7.7.0",
"eslint-webpack-plugin": "^3.1.1", "eslint-webpack-plugin": "^3.1.1",
"expose-loader": "1.0.1", "expose-loader": "1.0.1",
...@@ -74,7 +76,9 @@ ...@@ -74,7 +76,9 @@
"pdfjs-dist": "^2.6.347", "pdfjs-dist": "^2.6.347",
"portal-vue": "^2.1.7", "portal-vue": "^2.1.7",
"postcss": "^8.1.8", "postcss": "^8.1.8",
"postcss-less": "^6.0.0",
"postcss-loader": "4.1.0", "postcss-loader": "4.1.0",
"postcss-scss": "^4.0.4",
"sanitize-html": "^2.7.0", "sanitize-html": "^2.7.0",
"sass": "^1.29.0", "sass": "^1.29.0",
"sass-loader": "^10.1.0", "sass-loader": "^10.1.0",
...@@ -83,6 +87,9 @@ ...@@ -83,6 +87,9 @@
"sticky-kit": "1.1.3", "sticky-kit": "1.1.3",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"style-loader": "^2.0.0", "style-loader": "^2.0.0",
"stylelint": "^14.9.1",
"stylelint-config-standard": "^26.0.0",
"stylelint-junit-formatter": "^0.2.2",
"svgo": "^2.3.1", "svgo": "^2.3.1",
"tablesorter": "2.31.3", "tablesorter": "2.31.3",
"vrp-vue-resizable": "1.2.7", "vrp-vue-resizable": "1.2.7",
...@@ -122,5 +129,8 @@ ...@@ -122,5 +129,8 @@
"printWidth": 120, "printWidth": 120,
"singleQuote": true, "singleQuote": true,
"tabWidth": 4 "tabWidth": 4
},
"eslint-junit": {
"output": "./.reports/eslint-report.xml"
} }
} }
//** Major Breakpoints // Major Breakpoints
@major-breakpoint-tiny: 0; @major-breakpoint-tiny: 0;
@major-breakpoint-small: 576px; @major-breakpoint-small: 576px;
@major-breakpoint-medium: 768px; @major-breakpoint-medium: 768px;
......
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
@font-size-h5: @font-size-base; @font-size-h5: @font-size-base;
@font-size-h6: ceil((@font-size-base * 0.85)); // ~12px @font-size-h6: ceil((@font-size-base * 0.85)); // ~12px
//** Unit-less `line-height` for use in components like buttons. // Unit-less `line-height` for use in components like buttons.
@line-height-base: 1.428571429; // 20/14 @line-height-base: 1.428571429; // 20/14
//** Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc. // Computed "line-height" (`font-size` * `line-height`) for use with `margin`, `padding`, etc.
@line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px @line-height-computed: floor((@font-size-base * @line-height-base)); // ~20px
//** By default, this inherits from the `<body>`. // By default, this inherits from the `<body>`.
@headings-font-family: inherit; @headings-font-family: inherit;
@headings-font-weight: 550; @headings-font-weight: 550;
@headings-line-height: 1.1; @headings-line-height: 1.1;
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
@drag_and_drop_z_index: 1000; @drag_and_drop_z_index: 1000;
@drag_and_drop_border: 1px solid @base-color; @drag_and_drop_border: 1px solid @base-color;
//Avatar sizes: // Avatar sizes:
@avatar-small: 25px; @avatar-small: 25px;
@avatar-medium: 100px; @avatar-medium: 100px;
@avatar-normal: 250px; @avatar-normal: 250px;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment