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

Commit

Permalink
ci: Add prettier check to the CI checks (#219)
Browse files Browse the repository at this point in the history
  • Loading branch information
RabbitDoge committed Mar 10, 2021
1 parent abf42b5 commit c5d78c7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 12 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/format.yml
@@ -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
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
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

0 comments on commit c5d78c7

Please sign in to comment.