diff --git a/.github/workflows/pr-check_markdownlint.yml b/.github/workflows/pr-check_markdownlint.yml index 0a72f9d72b25838..2d05adb875b14d7 100644 --- a/.github/workflows/pr-check_markdownlint.yml +++ b/.github/workflows/pr-check_markdownlint.yml @@ -8,7 +8,7 @@ on: - "**/*.md" jobs: - docs: + cli2: runs-on: ubuntu-latest steps: @@ -18,8 +18,7 @@ jobs: id: changed-files uses: tj-actions/changed-files@v29.0.5 with: - files: | - **/*.md + files: "**/*.md" - name: Setup Node.js environment uses: actions/setup-node@v3 @@ -28,11 +27,36 @@ jobs: cache: yarn - name: Install all yarn packages - run: | - yarn --frozen-lockfile + run: yarn --frozen-lockfile - name: Lint markdown files run: | echo "::add-matcher::.github/workflows/markdownlint-problem-matcher.json" files_to_lint="${{ steps.changed-files.outputs.all_changed_files }}" yarn markdownlint-cli2 ${files_to_lint} + + prettier: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v29.0.5 + with: + files: "**/*.md" + + - name: Setup Node.js environment + uses: actions/setup-node@v3 + with: + node-version: "16" + cache: yarn + + - name: Install all yarn packages + run: yarn --frozen-lockfile + + - name: Prettier markdown files + run: | + files_to_lint="${{ steps.changed-files.outputs.all_changed_files }}" + yarn prettier -c ${files_to_lint} diff --git a/.prettierignore b/.prettierignore index d013b7c6c7bd2ed..681ec9fd8c88efa 100644 --- a/.prettierignore +++ b/.prettierignore @@ -3,3 +3,15 @@ build/ # Ignore markdown files till full pass is made on each folder *.md +# Opt-in folders that have prettier run on them +!/*.md +!/files/en-us/games/**/*.md +!/files/en-us/glossary/**/*.md +!/files/en-us/related/**/*.md +!/files/en-us/webassembly/**/*.md + +# Folders that have not fully run prettier for their code fences +# !/files/en-us/learn/**/*.md +# !/files/en-us/mdn/**/*.md +# !/files/en-us/mozilla/**/*.md +# !/files/en-us/web/**/*.md