Commit a5e68036 authored by Dominique Barton's avatar Dominique Barton 🦄
Browse files

TEST: Add testing for stylelint

parent 8294ae5e
Pipeline #8552 passed with stage
in 24 seconds
...@@ -18,12 +18,13 @@ Test Python: ...@@ -18,12 +18,13 @@ Test Python:
- dev - dev
- docker - docker
Test JavaScript: Test JavaScript & CSS:
stage: test stage: test
image: node:15 image: node:15
script: script:
- make -C test install-node - make -C test install-node
- make -C test test-eslint - make -C test test-eslint
- make -C test test-stylelint
interruptible: true interruptible: true
tags: tags:
- dev - dev
......
...@@ -7,10 +7,26 @@ extends: stylelint-config-standard ...@@ -7,10 +7,26 @@ extends: stylelint-config-standard
rules: rules:
#
# Colors
#
color-hex-length: long
color-named: never
#
# Syntax
#
indentation: 4 indentation: 4
declaration-colon-space-before: null declaration-colon-space-before: null
#
# Selectors
#
selector-type-no-unknown: selector-type-no-unknown:
- true - true
- ignore: - ignore:
......
...@@ -18,7 +18,7 @@ install-python: ...@@ -18,7 +18,7 @@ install-python:
install-node: install-node:
npm install npm install
install: install-python install-npm install: install-python install-node
# #
# Test # Test
...@@ -39,4 +39,7 @@ test-coverage: ...@@ -39,4 +39,7 @@ test-coverage:
test-eslint: test-eslint:
./validateOutput.sh "npx --silent eslint -c ../configs/eslintrc.yml files/test.js" output/eslint.txt ./validateOutput.sh "npx --silent eslint -c ../configs/eslintrc.yml files/test.js" output/eslint.txt
test-stylelint:
./validateOutput.sh "npx --silent stylelint --config ../configs/stylelintrc.yml files/test.css" output/stylelint.txt
test: test-isort test-pycodestyle test-pylint test-coverage test-eslint test: test-isort test-pycodestyle test-pylint test-coverage test-eslint
body {
color : hello;
background-color: #000;
border-color : black;
}
body {
color: #ffffff;
}
foo {
color: #000000;
}
x-foo {
color: #000000;
}
files/test.css
3:23 ✖ Expected "#000" to be "#000000" color-hex-length
4:23 ✖ Unexpected named color "black" color-named
7:1 ✖ Unexpected duplicate selector "body", first used at line 1 no-duplicate-selectors
11:1 ✖ Unexpected unknown type selector "foo" selector-type-no-unknown
13:5 ✖ Unexpected empty line before declaration declaration-empty-line-before
19:1 ✖ Unexpected empty line before closing brace block-closing-brace-empty-line-before
{ {
"dependencies": { "dependencies": {
"eslint": "latest" "eslint": "latest",
"stylelint": "latest",
"stylelint-config-standard": "latest"
} }
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment