diff options
author | Sarah German <sgerman@gitlab.com> | 2023-01-18 02:06:23 +0300 |
---|---|---|
committer | Sarah German <sgerman@gitlab.com> | 2023-01-18 02:06:23 +0300 |
commit | 8ae1f7da641a9254015ad33c2aafd067c856a3d2 (patch) | |
tree | b69fa2f520dd401fbb371a41f47f38f0a76fa3a0 | |
parent | 3254cf072ac195ac5808e3e384062bbc6a239c65 (diff) | |
parent | 3ef0ee3e63a48841f6a5af1c91dbee2b9dc97fe7 (diff) |
Merge branch 'eread/roll-out-markdownlint_cli2-to-more-places' into 'main'
Update markdownlint-cli2 dependency and use it for things
See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3418
Merged-by: Sarah German <sgerman@gitlab.com>
Approved-by: Sarah German <sgerman@gitlab.com>
Reviewed-by: Sarah German <sgerman@gitlab.com>
Co-authored-by: Evan Read <eread@gitlab.com>
-rw-r--r-- | .gitlab-ci.yml | 4 | ||||
-rw-r--r-- | .gitlab/ci/docker-images.gitlab-ci.yml | 1 | ||||
-rw-r--r-- | .gitlab/ci/test.gitlab-ci.yml | 3 | ||||
-rw-r--r-- | Makefile | 29 | ||||
-rw-r--r-- | doc/development.md | 10 | ||||
-rw-r--r-- | package.json | 1 | ||||
-rw-r--r-- | tasks/.markdownlint.yml (renamed from tasks/whitespace_task.yml) | 2 | ||||
-rw-r--r-- | yarn.lock | 49 |
8 files changed, 85 insertions, 14 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 41e89c7c..a6eb4f7f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -23,8 +23,8 @@ variables: GIT_DEPTH: '20' ALPINE_VERSION: '3.16' VALE_VERSION: '2.22.0' - MARKDOWNLINT_VERSION: '0.32.2' - MARKDOWNLINT2_VERSION: '0.5.1' + MARKDOWNLINT_VERSION: '0.32.2' # Version also set in package.json + MARKDOWNLINT2_VERSION: '0.6.0' # Version also set in package.json RUBY_VERSION: '2.7.7' # diff --git a/.gitlab/ci/docker-images.gitlab-ci.yml b/.gitlab/ci/docker-images.gitlab-ci.yml index b15032fd..e7a52819 100644 --- a/.gitlab/ci/docker-images.gitlab-ci.yml +++ b/.gitlab/ci/docker-images.gitlab-ci.yml @@ -104,6 +104,7 @@ test:image:docs-lint-markdown: --build-arg ALPINE_VERSION=${ALPINE_VERSION} --build-arg VALE_VERSION=${VALE_VERSION} --build-arg MARKDOWNLINT_VERSION=${MARKDOWNLINT_VERSION} + --build-arg MARKDOWNLINT2_VERSION=${MARKDOWNLINT2_VERSION} --file $DOCKERFILE . # diff --git a/.gitlab/ci/test.gitlab-ci.yml b/.gitlab/ci/test.gitlab-ci.yml index 36420fac..8e31c2e9 100644 --- a/.gitlab/ci/test.gitlab-ci.yml +++ b/.gitlab/ci/test.gitlab-ci.yml @@ -162,12 +162,11 @@ test_EOL_whitespace: before_script: [] dependencies: [] script: - - yarn global add markdownlint-cli@$MARKDOWNLINT_VERSION - apk add jq - bundle config set --local deployment true # Install dependencies into ./vendor/ruby - bundle install - bundle exec rake default - - markdownlint --config tasks/whitespace_task.yml '../gitlab/doc/**/*.md' '../gitlab-runner/doc/**/*.md' '../omnibus-gitlab/doc/**/*.md' '../charts-gitlab/doc/**/*.md' '../gitlab-operator/doc/**/*.md' + - make markdownlint-whitespace-tests test_unlinked_images: extends: @@ -163,7 +163,34 @@ yamllint-tests: markdownlint-tests: @printf "\n$(INFO)INFO: Running markdownlint tests...$(END)\n" - @yarn markdownlint doc/**/*.md + @yarn markdownlint-cli2 doc/**/*.md + +markdownlint-whitespace-tests-gitlab: + @printf "\n$(INFO)INFO: Running markdownlint whitespace tests on GitLab project...$(END)\n" + @cd ../gitlab/doc && markdownlint-cli2-config "../../gitlab-docs/tasks/.markdownlint.yml" "**/*.md" + +markdownlint-whitespace-tests-gitlab-runner: + @printf "\n$(INFO)INFO: Running markdownlint whitespace tests on GitLab Runner project...$(END)\n" + @cd ../gitlab-runner/docs && markdownlint-cli2-config "../../gitlab-docs/tasks/.markdownlint.yml" "**/*.md" + +markdownlint-whitespace-tests-omnibus-gitlab: + @printf "\n$(INFO)INFO: Running markdownlint whitespace tests on Omnibus GitLab project...$(END)\n" + @cd ../omnibus-gitlab/doc && markdownlint-cli2-config "../../gitlab-docs/tasks/.markdownlint.yml" "**/*.md" + +markdownlint-whitespace-tests-charts-gitlab: + @printf "\n$(INFO)INFO: Running markdownlint whitespace tests on GitLab Chart project...$(END)\n" + @cd ../charts-gitlab/doc && markdownlint-cli2-config "../../gitlab-docs/tasks/.markdownlint.yml" "**/*.md" + +markdownlint-whitespace-tests-gitlab-operator: + @printf "\n$(INFO)INFO: Running markdownlint whitespace tests on GitLab Operator project...$(END)\n" + @cd ../gitlab-operator/doc && markdownlint-cli2-config "../../gitlab-docs/tasks/.markdownlint.yml" "**/*.md" + +markdownlint-whitespace-tests: install-nodejs-dependencies + @$(MAKE) markdownlint-whitespace-tests-gitlab || true + @$(MAKE) markdownlint-whitespace-tests-gitlab-runner || true + @$(MAKE) markdownlint-whitespace-tests-omnibus-gitlab || true + @$(MAKE) markdownlint-whitespace-tests-charts-gitlab || true + @$(MAKE) markdownlint-whitespace-tests-gitlab-operator || true shellcheck-tests: @printf "\n$(INFO)INFO: Running shellcheck tests...$(END)\n" diff --git a/doc/development.md b/doc/development.md index b33ffdff..8dbc9abd 100644 --- a/doc/development.md +++ b/doc/development.md @@ -206,16 +206,14 @@ To add an additional set of product documentation to <https://docs.gitlab.com> f branch at all, you can omit this and the default branch will be always pulled. 1. Edit ['lib/edit_on_gitlab.rb'](../lib/edit_on_gitlab.rb) and add the product and its attributes to the `PRODUCT_REPOS` object, then add 1-2 test cases in [`spec/lib/helpers/edit_on_gitlab_spec.rb`](../spec/lib/helpers/edit_on_gitlab_spec.rb). - 1. Edit [`.test.gitlab-ci.yml`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/.gitlab/ci/test.gitlab-ci.yml) and add the new product to the following tests, following the same pattern as existing products: -- `test_global_nav_links` -- `test_EOL_whitespace` -- `test_unlinked_images` + - `test_global_nav_links` + - `test_EOL_whitespace` + - `test_unlinked_images` 1. Edit [`scripts/normalize-links.sh`](https://gitlab.com/gitlab-org/gitlab-docs/-/blob/main/scripts/normalize-links.sh) and add the new product to the `Relative URLs` and `Full URLs` sections. - 1. Edit the ['Makefile'](../Makefile): - Add a command to clone the repository, and add it to `clone-all-docs-projects` (see `../gitlab-operator/.git` as an example). @@ -226,6 +224,8 @@ To add an additional set of product documentation to <https://docs.gitlab.com> f - Add the new product to the list in [`doc/index.md`](../doc/index.md). - Add the new product to the diagram in [`doc/architecture.md`](../doc/architecture.md). +1. Add new whitespace test target to `markdownlint-whitespace-tests-gitlab` in `Makefile`. + ## Exclude a directory To exclude a directory so the contents aren't published to the docs site: diff --git a/package.json b/package.json index f0ca1d62..5c6ccbea 100644 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "jest-environment-jsdom": "^29.3.1", "jest-fail-on-console": "^3.0.2", "markdownlint-cli": "^0.33.0", + "markdownlint-cli2": "^0.6.0", "postcss": "^8.4.21", "prettier": "^2.8.3", "rollup": "^3.10.0", diff --git a/tasks/whitespace_task.yml b/tasks/.markdownlint.yml index bc59087c..dfeb14b8 100644 --- a/tasks/whitespace_task.yml +++ b/tasks/.markdownlint.yml @@ -1,4 +1,4 @@ --- +# Configuration for test_EOL_whitespace job default: false -no-inline-html: false no-trailing-spaces: true @@ -3631,7 +3631,7 @@ fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-glob@^3.2.12, fast-glob@^3.2.9: +fast-glob@^3.2.11, fast-glob@^3.2.12, fast-glob@^3.2.9: version "3.2.12" resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== @@ -3907,6 +3907,17 @@ globals@^13.19.0: dependencies: type-fest "^0.20.2" +globby@13.1.3: + version "13.1.3" + resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.3.tgz#f62baf5720bcb2c1330c8d4ef222ee12318563ff" + integrity sha512-8krCNHXvlCgHDpegPzleMq07yMYTO2sXKASmZmquEYWEmCx6J5UTRbp5RwMJkTJGtcQ44YpiUYUiN0b9mzy8Bw== + dependencies: + dir-glob "^3.0.1" + fast-glob "^3.2.11" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^4.0.0" + globby@^11.1.0: version "11.1.0" resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" @@ -5262,6 +5273,23 @@ markdown-it@13.0.1: mdurl "^1.0.1" uc.micro "^1.0.5" +markdownlint-cli2-formatter-default@0.0.3: + version "0.0.3" + resolved "https://registry.yarnpkg.com/markdownlint-cli2-formatter-default/-/markdownlint-cli2-formatter-default-0.0.3.tgz#5aecd6e576ad18801b76e58bbbaf0e916c583ab8" + integrity sha512-QEAJitT5eqX1SNboOD+SO/LNBpu4P4je8JlR02ug2cLQAqmIhh8IJnSK7AcaHBHhNADqdGydnPpQOpsNcEEqCw== + +markdownlint-cli2@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/markdownlint-cli2/-/markdownlint-cli2-0.6.0.tgz#ffa6aee4098e61f781e5e69528db60f7f39f737c" + integrity sha512-Bv20r6WGdcHMWi8QvAFZ3CBunf4i4aYmVdTfpAvXODI/1k3f09DZZ0i0LcX9ZMhlVxjoOzbVDz1NWyKc5hwTqg== + dependencies: + globby "13.1.3" + markdownlint "0.27.0" + markdownlint-cli2-formatter-default "0.0.3" + micromatch "4.0.5" + strip-json-comments "5.0.0" + yaml "2.2.1" + markdownlint-cli@^0.33.0: version "0.33.0" resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.33.0.tgz#703af1234c32c309ab52fcd0e8bc797a34e2b096" @@ -5277,7 +5305,7 @@ markdownlint-cli@^0.33.0: minimatch "~5.1.2" run-con "~1.2.11" -markdownlint@~0.27.0: +markdownlint@0.27.0, markdownlint@~0.27.0: version "0.27.0" resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.27.0.tgz#9dabf7710a4999e2835e3c68317f1acd0bc89049" integrity sha512-HtfVr/hzJJmE0C198F99JLaeada+646B5SaG2pVoEakLFI6iRGsvMqrnnrflq8hm1zQgwskEgqSnhDW11JBp0w== @@ -5350,7 +5378,7 @@ mermaid@^9.3.0: stylis "^4.1.2" uuid "^9.0.0" -micromatch@^4.0.4, micromatch@^4.0.5: +micromatch@4.0.5, micromatch@^4.0.4, micromatch@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== @@ -6462,6 +6490,11 @@ slash@^3.0.0: resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== +slash@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7" + integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew== + slice-ansi@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b" @@ -6642,6 +6675,11 @@ strip-indent@^3.0.0: dependencies: min-indent "^1.0.0" +strip-json-comments@5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-5.0.0.tgz#ec101b766476a703031bc607e3c712569de2aa06" + integrity sha512-V1LGY4UUo0jgwC+ELQ2BNWfPa17TIuwBLg+j1AA/9RPzKINl1lhxVEu2r+ZTTO8aetIsUzE5Qj6LMSBkoGYKKw== + strip-json-comments@^3.1.0, strip-json-comments@^3.1.1, strip-json-comments@~3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" @@ -7257,6 +7295,11 @@ yallist@^4.0.0: resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== +yaml@2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-2.2.1.tgz#3014bf0482dcd15147aa8e56109ce8632cd60ce4" + integrity sha512-e0WHiYql7+9wr4cWMx3TVQrNwejKaEe7/rHNmQmqRjazfOP5W8PB6Jpebb5o6fIapbz9o9+2ipcaTM2ZwDI6lw== + yaml@^1.10.0: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" |