-
Notifications
You must be signed in to change notification settings - Fork 3
54 lines (47 loc) · 1.5 KB
/
format.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
name: Format
on:
# code review question: this commits directly to PR branches.
# that seems like what we're looking for, but we could also format only
# committed code.
pull_request:
branches:
- main
# cancels in-progress jobs on this pull request
# avoids wasted work when a new commit is pushed
concurrency:
group: format-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions: read-all
jobs:
terraform-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup terraform
uses: hashicorp/setup-terraform@v2
- name: terraform fmt
id: tf_fmt
run: terraform fmt -check -recursive -diff cloud
shell-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run the shell checker
uses: luizm/action-sh-checker@master
env:
SHELLCHECK_OPTS: -s bash -S error
sh_checker_exclude: '*.md'
SHFMT_OPTS:
-bn -ci -i 2
# -i 2 indent 2 spaces
# -bn binary ops like && and | may start a line
# -ci switch cases will be indented
python-formatting:
name: python-formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: run YAPF to test if python code is correctly formatted
uses: AlexanderMelde/[email protected]
with:
args: "--verbose --style='{based_on_style: google, SPLIT_BEFORE_FIRST_ARGUMENT:true}'"