From 96fb7506db633135f1470dc0ed34b4b1e36e8ea0 Mon Sep 17 00:00:00 2001 From: silverwind Date: Sun, 9 Apr 2023 20:05:12 +0200 Subject: [PATCH] Introduce lint-md and compliance-docs pipeline (#24021) - Add new Make target `lint-md` - Add new Drone pipeline `compliance-docs` - Add `*.md` to docs exclusion/inclusion - Consistently quote `path.include` and `path.exclude` statements in YAML --- .drone.yml | 64 +++++++++++++++++++++++++++++++++++++++--------------- Makefile | 6 ++++- 2 files changed, 52 insertions(+), 18 deletions(-) diff --git a/.drone.yml b/.drone.yml index 225192c5d982..5f1167d286b6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -12,7 +12,8 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" + - "*.md" volumes: - name: deps @@ -181,7 +182,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" volumes: - name: deps @@ -266,6 +267,35 @@ steps: - name: deps path: /go +--- +kind: pipeline +type: docker +name: compliance-docs + +platform: + os: linux + arch: amd64 + +trigger: + event: + - pull_request + paths: + include: + - "docs/**" + - "*.md" + +steps: + - name: deps-frontend + image: node:18 + pull: always + commands: + - make deps-frontend + + - name: lint-md + image: node:18 + commands: + - make lint-md + --- kind: pipeline type: docker @@ -283,7 +313,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" volumes: - name: deps @@ -444,7 +474,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" volumes: - name: deps @@ -530,7 +560,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" volumes: - name: deps @@ -616,7 +646,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" volumes: - name: deps @@ -696,7 +726,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" volumes: - name: deps @@ -867,7 +897,7 @@ trigger: - push paths: exclude: - - docs/** + - "docs/**" depends_on: - testing-mysql @@ -1125,7 +1155,7 @@ trigger: - pull_request paths: include: - - docs/** + - "docs/**" steps: - name: build-docs @@ -1176,7 +1206,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" steps: - name: fetch-tags @@ -1253,7 +1283,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" steps: - name: fetch-tags @@ -1468,7 +1498,7 @@ trigger: - pull_request paths: exclude: - - docs/** + - "docs/**" steps: - name: dryrun @@ -1515,7 +1545,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" steps: - name: fetch-tags @@ -1592,7 +1622,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" steps: - name: fetch-tags @@ -1667,7 +1697,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" steps: - name: fetch-tags @@ -1834,7 +1864,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" depends_on: - docker-linux-amd64-release-version @@ -1884,7 +1914,7 @@ trigger: - cron paths: exclude: - - docs/** + - "docs/**" depends_on: - docker-linux-amd64-release diff --git a/Makefile b/Makefile index 56ac44eb1174..eb48766194f1 100644 --- a/Makefile +++ b/Makefile @@ -196,6 +196,7 @@ help: @echo " - lint lint everything" @echo " - lint-frontend lint frontend files" @echo " - lint-backend lint backend files" + @echo " - lint-md lint markdown files" @echo " - checks run various consistency checks" @echo " - checks-frontend check frontend files" @echo " - checks-backend check backend files" @@ -341,10 +342,13 @@ checks-backend: tidy-check swagger-check fmt-check misspell-check swagger-valida lint: lint-frontend lint-backend .PHONY: lint-frontend -lint-frontend: node_modules +lint-frontend: node_modules lint-md npx eslint --color --max-warnings=0 --ext js,vue web_src/js build *.config.js docs/assets/js tests/e2e npx stylelint --color --max-warnings=0 web_src/css npx spectral lint -q -F hint $(SWAGGER_SPEC) + +.PHONY: lint-md +lint-md: node_modules npx markdownlint docs *.md .PHONY: lint-backend