-
-
Notifications
You must be signed in to change notification settings - Fork 2
70 lines (70 loc) · 1.96 KB
/
lint.yaml
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
63
64
65
66
67
68
69
70
# SPDX-FileCopyrightText: © 2024 Kevin Lu
# SPDX-Licence-Identifier: AGPL-3.0-or-later
name: Lint pipeline code
on:
push:
branches: [master]
paths:
- src/**/*
pull_request:
branches: [master]
paths:
- src/**/*
permissions: {}
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# https://github.com/DataDog/guarddog
guarddog:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install guarddog
- run: guarddog pypi verify src/requirements.txt --output-format sarif --exclude-rules repository_integrity_mismatch > guarddog.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
category: guarddog-builtin
sarif_file: guarddog.sarif
# https://github.com/astral-sh/ruff
lint-python:
runs-on: ubuntu-latest
permissions:
security-events: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- run: pip install ruff
- run: ruff format --check src
- run: ruff check --output-format=github src
if: ${{ !cancelled() }}
- run: ruff check --output-format=sarif src > ruff.sarif
- uses: github/codeql-action/upload-sarif@v3
with:
category: ruff
sarif_file: ruff.sarif
lint-typescript:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: |
/*
!/data/
sparse-checkout-cone-mode: false
- uses: actions/setup-node@v4
with:
node-version: 20
cache: yarn
cache-dependency-path: yarn.lock
- run: yarn
- run: yarn prettier --check 'src/**/*.{js,ts}'
- if: ${{ !cancelled() }}
run: yarn eslint 'src/**/*.ts'