This repository has been archived by the owner on May 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
62 lines (55 loc) · 2.08 KB
/
prettier.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Run prettier and eslint
on:
push:
branches: [ master, development ]
paths:
- 'frontend/**'
pull_request:
branches: [ master, development ]
paths:
- 'frontend/**'
jobs:
container-job:
runs-on: ubuntu-latest
container:
image: mikxox/maven-test-action:latest
options: --rm
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
- name: install yarn and dependencies
run: |
npm install --global yarn
npm install --global eslint-formatter-rdjson
yarn install --frozen-lockfile
working-directory: ./frontend
- name: install reviewdog
run: |
wget -O - -q https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b /usr/local/bin/ v0.13.0
- name: eslint with reviewdog
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node_modules/.bin/eslint -f=rdjson . | reviewdog -f=rdjson -name="eslint" -reporter="github-pr-check" -level="error" -filter-mode="nofilter" -fail-on-error="true"
working-directory: ./frontend
- name: prettier with reviewdog
if: always()
env:
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
node_modules/.bin/prettier --check --config /__w/OSOC-1/OSOC-1/frontend/prettier.config.js --ignore-path /__w/OSOC-1/OSOC-1/frontend/.prettierignore . 2>&1 | sed --regexp-extended 's/(\[warn\].*)$/\1 File is not properly formatted./' \
| reviewdog \
-efm="%-G[warn] Code style issues found in the above file(s). Forgot to run Prettier%. File is not properly formatted." \
-efm="[%tarn] %f %m" \
-efm="%E[%trror] %f: %m (%l:%c)" \
-efm="%C[error]%r" \
-efm="%Z[error]%r" \
-efm="%-G%r" \
-name="prettier" \
-reporter="github-pr-check" \
-filter-mode="nofilter" \
-fail-on-error="true" \
-level="error"
working-directory: ./frontend