Archived
1
0

refactor: update prettier and doctoc (#5605)

* docs: add toc to CODE OF CONDUCT

* chore: add prettier ignore blocks to docs

* chore: update styles for Dockerfile

* refactor: separate prettier, doctoc

This does a couple things:
- update `.prettierignore`
- split `prettier` and `doctoc` commands. you can still run with `yarn
  fmt`
- delete `fmt.sh` and add `doctoc.sh`

By doing so, we can run tasks in parallel in CI and we should also have
less false positives than before with `yarn fmt` locally.

* refactor: update prettier job, add doctoc

This modifies the prettier job to use actionsx/prettier. It also adds a
job for `doctoc`.

* chore: upgrade to prettier 2.7.1

* chore: pin doctoc to 2.0.0

* fixup!: add .pc to prettierignore

* feat: add --cache to prettier cmd
This commit is contained in:
Joe Previte
2022-10-13 15:16:55 -07:00
committed by GitHub
parent d4707d1d24
commit 71a127a62b
15 changed files with 88 additions and 60 deletions

View File

@ -22,7 +22,7 @@ concurrency:
# will skip running `yarn install` if it successfully fetched from cache
jobs:
fmt:
prettier:
name: Format with Prettier
runs-on: ubuntu-latest
timeout-minutes: 5
@ -30,26 +30,39 @@ jobs:
- name: Checkout repo
uses: actions/checkout@v3
- name: Run prettier with actionsx/prettier
uses: actionsx/prettier@v2
with:
args: --check --loglevel=warn .
doctoc:
name: Doctoc markdown files
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v26.1
with:
files: |
docs/**
- name: Install Node.js v16
if: steps.changed-files.outputs.any_changed == 'true'
uses: actions/setup-node@v3
with:
node-version: "16"
cache: "yarn"
- name: Fetch dependencies from cache
id: cache-node-modules
uses: actions/cache@v3
with:
path: "**/node_modules"
key: yarn-build-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-build-
- name: Install doctoc
run: yarn global add doctoc@2.0.0
- name: Install dependencies
if: steps.cache-node-modules.outputs.cache-hit != 'true'
run: SKIP_SUBMODULE_DEPS=1 yarn --frozen-lockfile
- name: Format files with Prettier
run: yarn fmt
- name: Run doctoc
if: steps.changed-files.outputs.any_changed == 'true'
run: yarn doctoc
lint-helm:
name: Lint Helm chart