Repository navigation
102 lines (102 loc) · 3.05 KB
/
Copy pathlint.yml
File metadata and controls
102 lines (102 loc) · 3.05 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: lint
on:
push:
pull_request:
branches:
- main
- devel
jobs:
shfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install shfmt
run: |
curl -sS https://webi.sh/shfmt | sh
- name: Get all changed bash file
id: changed-bash-files
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
with:
files: |
**.sh
**.sh.in
**.bats
- name: Run shfmt check
if: steps.changed-bash-files.outputs.any_changed == 'true'
run: |
shfmt --indent 2 --case-indent --diff ${{ steps.changed-bash-files.outputs.all_changed_files }}
rubocop:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "4.0.1"
bundler-cache: true
- name: Install RuboCop
run: gem install rubocop
- name: Get all changed ruby file
id: changed-ruby-files
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
with:
files: |
**.rb
**.rb.in
- name: Run RuboCop
if: steps.changed-ruby-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-ruby-files.outputs.all_changed_files }}
run: |
rubocop --display-only-fail-level-offenses --fail-level W ${ALL_CHANGED_FILES}
rubocop --display-only-safe-correctable ${ALL_CHANGED_FILES}
yamlfmt:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
- name: Install yamlfmt
run: |
go install github.com/google/yamlfmt/cmd/yamlfmt@latest
- name: Get all changed yaml file
id: changed-yaml-files
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
with:
files: |
**.yml
**.yaml
files_ignore: |
backends/**/*_meta_parameters.yaml
- name: Run yamlfmt lint
if: steps.changed-yaml-files.outputs.any_changed == 'true'
run: yamlfmt -lint ${{ steps.changed-yaml-files.outputs.all_changed_files }}
clang-format:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Update APT index
run: sudo apt-get update
- name: Install clang-format
uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: clang-format-18
- name: Get changed C/C++ files
id: changed-cpp-files
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
with:
files: |
**.cpp
**.hpp
**.c
**.h
files_ignore: |
backends/**/include/
- name: Run clang-format
if: steps.changed-cpp-files.outputs.any_changed == 'true'
run: |
clang-format-18 --dry-run --Werror ${{ steps.changed-cpp-files.outputs.all_changed_files }}