Skip to content
This repository has been archived by the owner on Mar 16, 2021. It is now read-only.

ci: Add prettier check to the CI checks #219

Merged
merged 1 commit into from
Mar 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Format

on:
pull_request:

jobs:
commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
with:
configFile: .commitlintrc.json
helpURL: https://docs.pancakeswap.finance/code/contributing#committing
code:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup Node
uses: actions/setup-node@v2.1.2
with:
node-version: 14.x
- name: Install dependencies
run: yarn install
- name: Run check
run: yarn format:check
10 changes: 0 additions & 10 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ on:
pull_request:

jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wagoid/commitlint-github-action@v2
with:
configFile: .commitlintrc.json
helpURL: https://docs.pancakeswap.finance/code/contributing#committing
eslint:
runs-on: ubuntu-latest

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
"scripts": {
"build": "rm -rf ./dist && rollup -c && tsc -d --emitDeclarationOnly --declarationDir dist",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
"format:check": "prettier --check --loglevel error 'src/**/*.{js,jsx,ts,tsx}'",
"format:write": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook",
"test": "jest",
"release": "yarn build && np"
},
"husky": {
"hooks": {
"pre-commit": "yarn format",
"pre-commit": "yarn format:write",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
},
Expand Down