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 Feb 1, 2023
1 parent 48b9439 commit dffc20c
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 15 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,16 @@ on:
branches:
- main
paths:
- .github/workflows/markdown-lint.yml
- .github/workflows/markdownlint-problem-matcher.json
- .markdownlint-cli2.jsonc
- .prettierignore
- .prettierrc.json
- package.json
- yarn.lock
- .github/workflows/markdown-lint.yml
- .github/workflows/markdownlint-problem-matcher.json

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

steps:
Expand All @@ -25,8 +27,7 @@ jobs:
cache: yarn

- name: Install all yarn packages
run: |
yarn --frozen-lockfile
run: yarn --frozen-lockfile

- name: Lint markdown files
run: |
Expand Down
31 changes: 28 additions & 3 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 @@ -35,11 +35,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="${{ env.DIFF_DOCUMENTS }}"
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}
14 changes: 11 additions & 3 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,15 @@ build/
# Ignore markdown files till full pass is made on each folder
*.md
# The following paths have had a full pass
!files/en-us/glossary/**/*.md
!files/en-us/mdn/**/*.md
!files/en-us/web/http/**/*.md
!/*.md
!/files/en-us/games/**/*.md
!/files/en-us/glossary/**/*.md
!/files/en-us/mdn/**/*.md
!/files/en-us/related/**/*.md
!/files/en-us/web/http/**/*.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/mozilla/**/*.md
# !/files/en-us/web/**/*.md
1 change: 1 addition & 0 deletions files/en-us/mdn/community/issues/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ For example:
Ensure sections follow the order defined in the CSS property template

### Description

The CSS property page template is defined [here](https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Page_structures/Page_types/CSS_property_page_template).
The task list in this issue will be used to compare the documented CSS properties with the template and track changes to the property pages for compliance.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ True if and only if there is no domain name in the hostname (no dots).
#### Examples

```js
isPlainHostName("www.mozilla.org") // false
isPlainHostName("www") // true
isPlainHostName("www.mozilla.org"); // false
isPlainHostName("www"); // true
```

### `dnsDomainIs()`
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
"filecheck": "env-cmd --silent cross-env CONTENT_ROOT=files yari-filecheck --cwd=.",
"fix:js": "prettier -w \"**/*.(m)?js\"",
"fix:json": "prettier -w \"**/*.json(c)?\"",
"fix:md": "markdownlint-cli2-fix \"**/*.md\"",
"fix:md": "markdownlint-cli2-fix \"**/*.md\" && prettier -w \"**/*.md\"",
"fix:yml": "prettier -w \"**/*.yml\"",
"lint:js": "prettier -c \"**/*.(m)?js\"",
"lint:json": "prettier -c \"**/*.json(c)?\"",
"lint:md": "markdownlint-cli2 \"**/*.md\"",
"lint:md": "markdownlint-cli2 \"**/*.md\" && prettier -c \"**/*.md\"",
"lint:yml": "prettier -c \"**/*.yml\"",
"prepare": "husky install",
"start": "yarn up-to-date-check && env-cmd --silent cross-env CONTENT_ROOT=files REACT_APP_DISABLE_AUTH=true BUILD_OUT_ROOT=build yari-server",
Expand Down

0 comments on commit dffc20c

Please sign in to comment.