-
Notifications
You must be signed in to change notification settings - Fork 161
64 lines (62 loc) · 1.74 KB
/
lint.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
63
64
name: Run lint
on:
# Push to master or PR
push:
branches:
- master
pull_request:
jobs:
linter:
name: "Run linter"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1
- name: Install linter
run: |
pip install flake8 pylint
- name: Lint codebase
run: |
make lint GITHUB_ACTIONS_FORMATTING=1
- name: Install bibtex linter
run: |
pip install bibtexparser
- name: Check bibtex
run: |
cd docs
make validate-bibtex
actionlint:
name: "Lint Github actions YAML files"
# There's a way to add error formatting so GH actions adds messages to code,
# but I can't work out the right number of quotes to get it to work
# https://github.com/rhysd/actionlint/blob/main/docs/usage.md
# #example-error-annotation-on-github-actions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check workflow files
uses: docker://rhysd/actionlint:latest
with:
args: -color
docker_linter:
name: "Lint dockerfiles"
runs-on: ubuntu-latest
container:
image: hadolint/hadolint:latest-alpine
env:
HADOLINT_IGNORE: "DL3005,DL3007,DL3008,DL3015,DL3059"
steps:
- uses: actions/checkout@v4
- name: Lint dockerfiles inside hadolint container
run: |
for DOCKERFILE in docker/Dockerfile.*; \
do \
echo " Linting $DOCKERFILE"; \
hadolint "$DOCKERFILE" \
|| exit 1; \
done