Skip to content

Commit

Permalink
chore: Opt-in cleaned folders and CI for Prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Sep 13, 2022
1 parent e47cebe commit 73dfe0f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 5 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/pr-check_markdownlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
- "**/*.md"

jobs:
docs:
cli2:
runs-on: ubuntu-latest

steps:
Expand All @@ -18,8 +18,7 @@ jobs:
id: changed-files
uses: tj-actions/[email protected]
with:
files: |
**/*.md
files: "**/*.md"

- name: Setup Node.js environment
uses: actions/setup-node@v3
Expand All @@ -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/[email protected]
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}
12 changes: 12 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 73dfe0f

Please sign in to comment.