-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (48 loc) · 1.49 KB
/
linting_auto.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
name: Monorepo Code Linting - Auto Linter
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- unlabeled
- labeled
- synchronize
jobs:
run-linters:
name: Run C++/Python linters
runs-on: ubuntu-latest
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GHCR_PWD }}
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Python dependencies
run: pip install autopep8 clang-format
- name: Run linters, make changes
continue-on-error: true
uses: WATonomous/wato-lint-action@v1
with:
auto_fix: ${{ contains(github.event.pull_request.labels.*.name, 'auto-lint') }}
Autopep8: true
Autopep8_args: "--max-line-length 100"
clang_format: true
clang_format_auto_fix: ${{ contains(github.event.pull_request.labels.*.name, 'auto-lint') }}
clang_format_args: "-style=file"
- name: Remove 'auto-lint' label to stop possible inf loop
if: contains(github.event.pull_request.labels.*.name, 'auto-lint')
uses: actions/github-script@v6
with:
script: |
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'auto-lint'
});