Skip to content

Commit eff197a

Browse files
Menrathabias
authored andcommitted
add: ci-lint workflow (#4)
1 parent 49e5c8c commit eff197a

File tree

5 files changed

+193
-0
lines changed

5 files changed

+193
-0
lines changed

.github/workflows/lint.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: SCSS Linting
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint-scss:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v2
18+
19+
- name: Set up Node.js
20+
uses: actions/setup-node@v2
21+
with:
22+
node-version: '22'
23+
24+
- name: Install npm dependencies
25+
run: |
26+
npm install
27+
28+
- name: Run SCSS Linting
29+
run: |
30+
grunt stylelint:scss

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
package-lock.json
2+
node_modules/

.stylelintrc

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
{
2+
"customSyntax": "postcss-scss",
3+
"plugins": [
4+
"stylelint-csstree-validator"
5+
],
6+
"rules": {
7+
"csstree/validator": {
8+
"syntaxExtensions": [
9+
"sass"
10+
]
11+
},
12+
"at-rule-empty-line-before": [ "always",
13+
{"except": [ "blockless-after-blockless"], ignore: ["after-comment", "inside-block"]}
14+
],
15+
"at-rule-name-case": "lower",
16+
"at-rule-name-space-after": "always-single-line",
17+
"at-rule-no-unknown": null, # Enabled for non-scss in grunt.
18+
"at-rule-semicolon-newline-after": "always",
19+
"at-rule-semicolon-space-before": "never",
20+
"block-closing-brace-newline-after": "always",
21+
"block-closing-brace-newline-before": "always",
22+
"block-closing-brace-space-before": "always-single-line",
23+
"block-no-empty": true,
24+
"block-opening-brace-newline-after": "always",
25+
"block-opening-brace-space-after": "always-single-line",
26+
"block-opening-brace-space-before": "always",
27+
"color-hex-case": ["lower", { "severity": "warning" }],
28+
"color-hex-length": ["short", { "severity": "warning" }],
29+
"color-no-invalid-hex": true,
30+
"declaration-bang-space-after": "never",
31+
"declaration-bang-space-before": "always",
32+
"declaration-block-no-duplicate-properties": true,
33+
"declaration-block-no-shorthand-property-overrides": true,
34+
"declaration-block-semicolon-newline-after": "always-multi-line",
35+
"declaration-block-semicolon-space-after": "always-single-line",
36+
"declaration-block-semicolon-space-before": "never",
37+
"declaration-block-single-line-max-declarations": 1,
38+
"declaration-block-trailing-semicolon": "always",
39+
"declaration-colon-newline-after": "always-multi-line",
40+
"declaration-colon-space-after": "always-single-line",
41+
"declaration-colon-space-before": "never",
42+
"declaration-no-important": null,
43+
"font-family-no-duplicate-names": true,
44+
"function-calc-no-unspaced-operator": true,
45+
"function-comma-newline-after": "always-multi-line",
46+
"function-comma-space-after": "always-single-line",
47+
"function-comma-space-before": "never",
48+
"function-linear-gradient-no-nonstandard-direction": true,
49+
"function-max-empty-lines": 0,
50+
"function-name-case": "lower",
51+
"function-parentheses-newline-inside": "always-multi-line",
52+
"function-parentheses-space-inside": "never-single-line",
53+
"function-url-scheme-disallowed-list": ["data"],
54+
"function-whitespace-after": "always",
55+
"indentation": 4,
56+
"keyframe-declaration-no-important": true,
57+
"length-zero-no-unit": [true, { "severity": "warning" }],
58+
"max-empty-lines": 2,
59+
"max-line-length": [132, { "severity": "warning" }],
60+
"media-feature-colon-space-after": "always",
61+
"media-feature-colon-space-before": "never",
62+
"media-feature-parentheses-space-inside": "never",
63+
"media-feature-range-operator-space-after": "always",
64+
"media-feature-range-operator-space-before": "always",
65+
"media-query-list-comma-newline-after": "always-multi-line",
66+
"media-query-list-comma-space-after": "always-single-line",
67+
"media-query-list-comma-space-before": "never",
68+
"no-empty-source": true,
69+
"no-eol-whitespace": true,
70+
"no-extra-semicolons": [true, { "severity": "warning" }],
71+
"no-invalid-double-slash-comments": true,
72+
"no-unknown-animations": true,
73+
"property-case": "lower",
74+
"property-no-unknown": true,
75+
"selector-attribute-brackets-space-inside": "never",
76+
"selector-attribute-operator-space-after": "never",
77+
"selector-attribute-operator-space-before": "never",
78+
"selector-combinator-space-after": "always",
79+
"selector-combinator-space-before": "always",
80+
"selector-list-comma-newline-after": "always",
81+
"selector-list-comma-space-before": "never",
82+
"selector-max-empty-lines": 0,
83+
"selector-pseudo-class-case": "lower",
84+
"selector-pseudo-class-no-unknown": true,
85+
"selector-pseudo-class-parentheses-space-inside": "never",
86+
"selector-pseudo-element-case": "lower",
87+
"selector-pseudo-element-no-unknown": true,
88+
"selector-type-case": "lower",
89+
"selector-type-no-unknown": true,
90+
"string-no-newline": true,
91+
"time-min-milliseconds": 100,
92+
"unit-disallowed-list": ["pt"],
93+
"unit-case": "lower",
94+
"unit-no-unknown": true,
95+
"value-keyword-case": ["lower", {"ignoreKeywords": ["/(@|$)/"]}],
96+
"value-list-comma-newline-after": "always-multi-line",
97+
"value-list-comma-space-after": "always-single-line",
98+
"value-list-comma-space-before": "never",
99+
},
100+
"overrides": [
101+
{
102+
"files": ["**/yui/**/*.css"],
103+
"rules": {
104+
}
105+
}
106+
]
107+
}

Gruntfile.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
module.exports = function(grunt) {
2+
// Load the plugins
3+
grunt.loadNpmTasks('grunt-stylelint');
4+
5+
// Project configuration
6+
grunt.initConfig({
7+
stylelint: {
8+
scss: {
9+
options: {
10+
quietDeprecationWarnings: true,
11+
customSyntax: 'postcss-scss',
12+
},
13+
src: ['snippets/**/*.scss']
14+
}
15+
},
16+
watch: {
17+
scss: {
18+
files: ['snippets/**/*.scss'],
19+
tasks: ['stylelint:scss']
20+
}
21+
}
22+
});
23+
24+
// Register default task
25+
grunt.registerTask('default', ['stylelint:scss']);
26+
};

package.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "moodle-theme_boost_union_snippets",
3+
"version": "1.0.0",
4+
"description": "SCSS snippets repository for Moodle Boost Union Theme",
5+
"main": "index.js",
6+
"scripts": {
7+
"lint": "grunt stylelint:scss"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets.git"
12+
},
13+
"keywords": [],
14+
"author": "",
15+
"license": "GPL-3.0",
16+
"bugs": {
17+
"url": "https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets/issues"
18+
},
19+
"homepage": "https://github.com/moodle-an-hochschulen/moodle-theme_boost_union_snippets#readme",
20+
"devDependencies": {
21+
"grunt": "^1.6.1",
22+
"grunt-sass": "3.1.0",
23+
"grunt-stylelint": "^0.19.0",
24+
"postcss-scss": "^4.0.9",
25+
"stylelint": "^15.11.0",
26+
"stylelint-csstree-validator": "^3.0.0"
27+
}
28+
}

0 commit comments

Comments
 (0)