Skip to content

Commit

Permalink
ci: add github action to lint and prettify on PR lvl
Browse files Browse the repository at this point in the history
  • Loading branch information
tmrdlt committed Mar 13, 2024
1 parent 10f42dc commit f7620dd
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 3 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Code Check

on:
push:
branches:
- main
pull_request: {}

concurrency:
group: ${{ github.job }}-${{ github.ref }}
cancel-in-progress: true

jobs:
lint:
runs-on: ubuntu-latest
name: Lint
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Lint
run: npm run lint:check
- name: Prettier
run: npm run format:check
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
"postinstall": "npx prisma generate",
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
"serve": "nest start",
"serve:dev": "nest start --watch",
"serve:debug": "nest start --debug --watch",
"serve:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint:check": "eslint \"{src,apps,libs,test}/**/*.ts\"",
"test": "jest",
"test:watch": "test jest --watch",
"test:cov": "jest --coverage",
Expand Down
5 changes: 2 additions & 3 deletions src/api/pairs/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,8 @@ the real response type is \`Array<Array<PairWithLiquidityAndTokenAddresses>>\``,
@Query('only-listed') onlyListedStr: string, //false | true
): Promise<dto.PairWithLiquidityAndTokenAddresses[][]> {
const onlyListed = !!onlyListedStr && onlyListedStr !== 'false';
const pairs = await this.pairsService.getAllPairsWithLiquidityInfo(
!!onlyListed,
);
const pairs =
await this.pairsService.getAllPairsWithLiquidityInfo(!!onlyListed);
const edges = pairs.map((data) => ({
data,
t0: data.token0.address,
Expand Down

0 comments on commit f7620dd

Please sign in to comment.