Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
Gitlab CI for Drupal 10+
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
gitlab-drupal-ci
Gitlab CI for Drupal 10+
Commits
e6fb5f79
Commit
e6fb5f79
authored
3 years ago
by
Jean Valverde
Browse files
Options
Downloads
Patches
Plain Diff
feat: stylelint html report, use npx
parent
47dafa3d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci/.gitlab-ci-template.yml
+9
-18
9 additions, 18 deletions
.gitlab-ci/.gitlab-ci-template.yml
docs/advanced-usage.md
+4
-0
4 additions, 0 deletions
docs/advanced-usage.md
with
13 additions
and
18 deletions
.gitlab-ci/.gitlab-ci-template.yml
+
9
−
18
View file @
e6fb5f79
...
...
@@ -336,7 +336,6 @@ php-qa:
# This is a eslint report based on Drupal 8/9 standards.
# https://www.drupal.org/docs/develop/standards/javascript
# @todo junit report.
lint_js
:
stage
:
tests
extends
:
.lint_template
...
...
@@ -345,25 +344,16 @@ lint_js:
when
:
never
-
when
:
always
script
:
# Added eslint option for Drupal 9.0+.
# @todo move as default option when 8.9 is deprecated.
-
|
if [ 1 -eq "$(echo "${CI_DRUPAL_VERSION} >= 9.0" | bc)" ]; then
ESLINT_RESOLVE_FIX="--resolve-plugins-relative-to ${WEB_ROOT}/core"
fi
# Run the eslint command to generate an html report.
# --format junit --output-file "${CI_PROJECT_DIR}/report-${CI_JOB_NAME}/eslint-unit.xml"
-
cd ${WEB_ROOT}/core && node_modules/.bin/eslint
-
cd ${WEB_ROOT}/core
-
npx eslint
--config .eslintrc.passing.json
${ESLINT_RESOLVE_FIX}
--resolve-plugins-relative-to ${WEB_ROOT}/core
--format html
--output-file "${CI_PROJECT_DIR}/report-${CI_JOB_NAME}/eslint.html"
"${DIRS_JS}"
# Drupal
8/
9 rules used here for stylelint to check css.
# Drupal 9 rules used here for stylelint to check css.
# https://www.drupal.org/docs/develop/standards/css
# @todo stylelint html & junit report. + sass / scss support?
# https://www.npmjs.com/package/stylelint-junit-formatter
lint_css
:
stage
:
tests
extends
:
.lint_template
...
...
@@ -372,12 +362,13 @@ lint_css:
when
:
never
-
when
:
always
script
:
# Css report, terminal only.
-
cd ${WEB_ROOT}/core && node_modules/.bin/stylelint
-
cd ${WEB_ROOT}/core
-
yarn add stylelint-html-formatter
-
npx stylelint
--config .stylelintrc.json
--formatter verbose
--custom-formatter node_modules/stylelint-html-formatter
--output-file ${CI_PROJECT_DIR}/report-${CI_JOB_NAME}/stylelint.html
"${DIRS_CSS}"
2>&1 | tee ${CI_PROJECT_DIR}/report-${CI_JOB_NAME}/lint_css.txt
lint_twig
:
stage
:
tests
...
...
This diff is collapsed.
Click to expand it.
docs/advanced-usage.md
+
4
−
0
View file @
e6fb5f79
...
...
@@ -270,7 +270,11 @@ Eslint is based on the official
Stylelint is based on the official
[
Drupal 8/9 stylelintrc.json
](
https://git.drupalcode.org/project/drupal/raw/HEAD/core/.stylelintrc.json
)
Both provide a html report that you can browse from within Gitlab CI.
_Note:_
As this project is meant for Drupal, there is no override for these files.
To setup your own rules for your css and js file you need to override these jobs
and include your own config file.
### Metrics jobs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment