forked from PelicanPlatform/pelican
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (55 loc) · 1.56 KB
/
pre-commit-linter.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
name: Linter
on:
push:
tags:
- "*"
branches:
- master
- main
pull_request:
jobs:
go-linter:
name: linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.21'
cache: false
# We embed the contents of web_ui/frontend/out/* into the resulting binaries
# That particular directory should contain outputs generated by the
# npm build. However, to keep the runtime of the linter as fast as possible,
# instead of running `npm` here, we simply create a dummy empty file.
#
# If no dummy file exists, then the linters will flag the situation as
# an error.
- name: Generate placeholder files
id: generate-placeholder
run: |
go generate ./...
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
# We still run this so that we can get the nice hint of gofmt issues inline
- name: Run golangci-lint
uses: golangci/golangci-lint-action@v6
with:
version: latest
- name: Run pre-commit
uses: pre-commit/action@v3.0.1
prettier-linter:
name: prettier-linter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Move to the web repository
run: |
cd web_ui/frontend
npm install
npm run format