diff --git a/.github/linters/.markdownlint.yml b/.github/linters/.markdownlint.yml deleted file mode 100644 index 7c89f2e2..00000000 --- a/.github/linters/.markdownlint.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -########################### -########################### -## Markdown Linter rules ## -########################### -########################### - -# Linter rules doc: -# - https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md -# -# Note: -# To comment out a single error: -# -# any violations you want -# -# - -# Default state for all rules -default: false - -################# -# Rules by tags # -################# -blanks-around-fences: true # Fenced code blocks should be surrounded by blank lines -blanks-around-headings: true # Headings should be surrounded by blank lines -blanks-around-lists: true # Lists should be surrounded by blank lines -code-block-style: - style: "fenced" -code-fence-style: - style: "backtick" -emphasis-style: - style: "consistent" -fenced-code-language: true # Fenced code blocks should have a language specified -heading-start-left: true # Headings must start at the beginning of the line -heading-style: - style: "atx" -hr-style: true # Horizontal rule style -list-indent: true # Inconsistent indentation for list items at the same level -no-empty-links: true -no-missing-space-atx: true # No space after hash on atx style heading -no-multiple-blanks: true # Multiple consecutive blank lines -no-reversed-links: true -no-space-in-code: true -no-space-in-emphasis: true -no-space-in-links: true -no-trailing-spaces: true -single-trailing-newline: true # Files should end with a single newline character -strong-style: - style: "consistent" -ul-style: - style: "consistent" diff --git a/.github/linters/.yaml-lint.yml b/.github/linters/.yaml-lint.yml deleted file mode 100644 index b10948eb..00000000 --- a/.github/linters/.yaml-lint.yml +++ /dev/null @@ -1,59 +0,0 @@ ---- -########################################### -# These are the rules used for # -# linting all the yaml files in the stack # -# NOTE: # -# You can disable line with: # -# # yamllint disable-line # -########################################### -rules: - braces: - level: warning - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: 1 - max-spaces-inside-empty: 5 - brackets: - level: warning - min-spaces-inside: 0 - max-spaces-inside: 0 - min-spaces-inside-empty: 1 - max-spaces-inside-empty: 5 - colons: - level: warning - max-spaces-before: 0 - max-spaces-after: 1 - commas: - level: warning - max-spaces-before: 0 - min-spaces-after: 1 - max-spaces-after: 1 - comments: disable - comments-indentation: disable - document-end: disable - document-start: - level: warning - present: true - empty-lines: - level: warning - max: 2 - max-start: 0 - max-end: 0 - hyphens: - level: warning - max-spaces-after: 1 - indentation: - level: warning - spaces: consistent - indent-sequences: true - check-multi-line-strings: false - key-duplicates: enable - line-length: - level: warning - max: 100 - allow-non-breakable-words: true - allow-non-breakable-inline-mappings: true - new-line-at-end-of-file: disable - new-lines: - type: unix - trailing-spaces: disable diff --git a/.github/super-linter.env b/.github/super-linter.env deleted file mode 100644 index feebdd46..00000000 --- a/.github/super-linter.env +++ /dev/null @@ -1,6 +0,0 @@ -IGNORE_GITIGNORED_FILES=true -VALIDATE_GITLEAKS=true -VALIDATE_MARKDOWN=true -MARKDOWN_CONFIG_FILE=.markdownlint.yml -VALIDATE_YAML=true -VALIDATE_JSON=true diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml new file mode 100644 index 00000000..35105497 --- /dev/null +++ b/.github/workflows/lint-md.yml @@ -0,0 +1,24 @@ +name: Lint Markdown + +on: + pull_request: + paths: + - '**/*.md' + +jobs: + markdownlint: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + + - name: Install markdownlint-cli + run: npm install -g markdownlint-cli + + - name: Run markdownlint + run: markdownlint "**/*.md" --config .markdownlint.json diff --git a/.github/workflows/test-pull-request.yml b/.github/workflows/test-pull-request.yml index 5be49b28..1bf26801 100644 --- a/.github/workflows/test-pull-request.yml +++ b/.github/workflows/test-pull-request.yml @@ -42,23 +42,17 @@ jobs: # Full git history is needed to get a proper list of changed files # within `super-linter` fetch-depth: 0 - - name: Load Super Linter Environment - run: cat ".github/super-linter.env" >> "$GITHUB_ENV" - - ################################ - # Run Linters against code base # - ################################ - - name: Lint Code Base - # - # Use full version number to avoid cases when a next - # released version is buggy - # About slim image: https://github.com/github/super-linter#slim-image - uses: github/super-linter/slim@v4.10.1 + + - name: Run Super Linter + uses: github/super-linter@v5 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_MARKDOWN: true + VALIDATE_YAML: true + VALIDATE_JSON: true + MARKDOWN_CONFIG_FILE: .markdownlint.json DEFAULT_BRANCH: main - VALIDATE_ALL_CODEBASE: false - VALIDATE_GITHUB_ACTIONS: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: true - name: Setup Node v16 for Yarn v3 uses: actions/setup-node@v3 @@ -83,7 +77,7 @@ jobs: - name: Check internal links uses: borales/actions-yarn@v3 with: - cmd: test:links + cmd: checkLinks - name: Build site if: ${{ success() }} @@ -104,10 +98,10 @@ jobs: uses: actions/setup-node@v3 with: node-version: '18' - + - name: Enable Corepack for Yarn v3 run: corepack enable - + - name: Install Yarn v3 uses: borales/actions-yarn@v3 with: @@ -132,22 +126,22 @@ jobs: YARN_ENABLE_HARDENED_MODE: false with: cmd: install --mode=update-lockfile - + - name: Run PR script run: node src/pr-scripts.js env: PR_ID: ${{ github.event.pull_request.number }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Run AI metadata generation script run: node src/ai-scripts.js env: AZURE_OPENAI_ENDPOINT: ${{ secrets.AZURE_OPENAI_ENDPOINT }} AZURE_OPENAI_API_KEY: ${{ secrets.AZURE_OPENAI_API_KEY }} FILE_NAME: "pr_content.txt" - + - name: Run review PR script run: node src/review-scripts.js env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_ID: ${{ github.event.pull_request.number }} \ No newline at end of file + PR_ID: ${{ github.event.pull_request.number }} diff --git a/.markdownlint.json b/.markdownlint.json new file mode 100644 index 00000000..cd8badd8 --- /dev/null +++ b/.markdownlint.json @@ -0,0 +1,10 @@ +{ + "default": false, + "MD009": true, + "MD012": true, + "MD013": false, + "MD041": true, + "MD025": true, + "MD024": true, + "MD026": true +} diff --git a/.markdownlint.yml b/.markdownlint.yml deleted file mode 120000 index d709e3e4..00000000 --- a/.markdownlint.yml +++ /dev/null @@ -1 +0,0 @@ -.github/linters/.markdownlint.yml \ No newline at end of file diff --git a/.markdownlintignore b/.markdownlintignore new file mode 100644 index 00000000..becf9d59 --- /dev/null +++ b/.markdownlintignore @@ -0,0 +1,4 @@ +node_modules/ +dist/ +CHANGELOG.md +docs/old/ diff --git a/package.json b/package.json index ff531c8d..4577289e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "build": "gatsby build", "serve": "gatsby serve", "clean": "gatsby clean", - "lint": "docker run --rm -e RUN_LOCAL=true --env-file '.github/super-linter.env' -v \"$PWD\":/tmp/lint github/super-linter:slim-v4.10.1", + "lint:md": "markdownlint-cli '**/*.md' --config .markdownlint.json", "buildNavigation": "npx --yes github:AdobeDocs/adp-devsite-utils buildNavigation -v", "buildRedirections": "npx --yes github:AdobeDocs/adp-devsite-utils buildRedirections -v", "renameFiles": "npx --yes github:AdobeDocs/adp-devsite-utils renameFiles -v", @@ -47,7 +47,7 @@ "devDependencies": { "express": "5.1.0", "glob": "11.0.0", - "markdown-link-check": "^3.13.7", + "markdownlint-cli": "^0.39.0", "remark-cli": "^11.0.0", "remark-validate-links": "^12.1.0" }