-
Notifications
You must be signed in to change notification settings - Fork 35
734 lines (702 loc) · 21.7 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
---
name: . Lint
'on':
workflow_call:
jobs:
detect-changes:
name: Detect Changes
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
permissions:
pull-requests: read
outputs:
api-go: ${{ steps.filter.outputs.api-go }}
api-node: ${{ steps.filter.outputs.api-node }}
ethereum: ${{ steps.filter.outputs.ethereum }}
grafana-hm-panel-plugin: ${{ steps.filter.outputs.grafana-hm-panel-plugin }}
hm-spark-find-retired-people-scala: ${{ steps.filter.outputs.hm-spark-find-retired-people-scala }}
hm-spark-ingest-from-s3-to-kafka: ${{ steps.filter.outputs.hm-spark-ingest-from-s3-to-kafka }}
mobile-android: ${{ steps.filter.outputs.mobile-android }}
mobile-react-native: ${{ steps.filter.outputs.mobile-react-native }}
kubernetes: ${{ steps.filter.outputs.kubernetes }}
web: ${{ steps.filter.outputs.web }}
web-cypress: ${{ steps.filter.outputs.web-cypress }}
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- uses: dorny/paths-filter@v3.0.2
id: filter
with:
filters: |
api-go:
- '.github/workflows/.lint.yml'
- 'api-go/**'
api-node:
- '.github/workflows/.lint.yml'
- 'api-node/**'
ethereum:
- '.github/workflows/.lint.yml'
- 'ethereum/**'
grafana-hm-panel-plugin:
- '.github/workflows/.lint.yml'
- 'data-visualization/grafana/hm-panel-plugin/**'
hm-spark-find-retired-people-scala:
- '.github/workflows/.lint.yml'
- 'data-processing/hm-spark/applications/find-retired-people-scala/**'
hm-spark-ingest-from-s3-to-kafka:
- '.github/workflows/.lint.yml'
- 'data-processing/hm-spark/applications/ingest-from-s3-to-kafka/**'
kubernetes:
- '.github/workflows/.lint.yml'
- 'kubernetes/manifests/**'
mobile-android:
- '.github/workflows/.lint.yml'
- 'mobile/mobile-android/**'
mobile-react-native:
- '.github/workflows/.lint.yml'
- 'mobile/mobile-react-native/**'
web:
- '.github/workflows/.lint.yml'
- 'web/**'
web-cypress:
- '.github/workflows/.lint.yml'
- 'web-cypress/**'
lint-ansible:
name: Ansible
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Install dependencies from Ansible Galaxy
run: |
poetry run poe ansible-galaxy-install -- --role-file=ansible/requirements.yml
- name: Lint Ansible
run: |
poetry run poe lint-ansible
lint-c-cpp:
name: C, C++
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Lint C, C++
uses: DoozyX/clang-format-lint-action@v0.18.2
with:
source: .
extensions: c,cpp,cu,h,ino
clangFormatVersion: 18
style: file
lint-cmake:
name: CMake
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Lint CMake
run: |
poetry run poe lint-cmake
lint-commit-message:
name: Commit Message
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
with:
fetch-depth: 0
- name: Lint Commit
uses: wagoid/commitlint-github-action@v6.1.2
lint-css:
name: CSS
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: |
npm ci
- name: Lint CSS
run: |
npm run lint:css
lint-dockerfile:
name: Dockerfile
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Lint Dockerfile
uses: jbergstroem/hadolint-gh-action@v1.12.2
with:
dockerfile: '**/Dockerfile*'
lint-go:
name: Go
needs: detect-changes
if: ${{ needs.detect-changes.outputs.api-go == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Go
uses: actions/setup-go@v5.0.2
with:
go-version-file: api-go/go.mod
cache-dependency-path: api-go/go.sum
- name: Lint Go
uses: golangci/golangci-lint-action@v6.1.1
with:
version: latest
working-directory: api-go
args: --timeout=10m
lint-javascript-api-node:
name: JavaScript (api-node)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.api-node == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: api-node/.nvmrc
cache: npm
cache-dependency-path: api-node/package-lock.json
- name: Install dependencies
working-directory: api-node
run: |
npm ci
- name: Lint JavaScript
working-directory: api-node
run: |
npm run lint:javascript
lint-javascript-ethereum:
name: JavaScript (ethereum)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.ethereum == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: ethereum/.nvmrc
cache: npm
cache-dependency-path: ethereum/package-lock.json
- name: Install dependencies
working-directory: ethereum
run: |
npm ci
- name: Lint JavaScript
working-directory: ethereum
run: |
npm run lint:javascript
lint-javascript-grafana-hm-panel-plugin:
name: JavaScript (grafana-hm-panel-plugin)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.grafana-hm-panel-plugin == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: data-visualization/grafana/hm-panel-plugin/.nvmrc
cache: npm
cache-dependency-path: data-visualization/grafana/hm-panel-plugin/package-lock.json
- name: Install dependencies
working-directory: data-visualization/grafana/hm-panel-plugin
run: |
npm ci
- name: Lint JavaScript
working-directory: data-visualization/grafana/hm-panel-plugin
run: |
npm run lint:javascript
lint-javascript-mobile-react-native:
name: JavaScript (mobile-react-native)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.mobile-react-native == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: mobile/mobile-react-native/.nvmrc
cache: npm
cache-dependency-path: mobile/mobile-react-native/package-lock.json
- name: Install dependencies
working-directory: mobile/mobile-react-native
run: |
npm ci
- name: Lint JavaScript
working-directory: mobile/mobile-react-native
run: |
npm run lint:javascript
lint-javascript-web:
name: JavaScript (web)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.web == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: web/.nvmrc
cache: npm
cache-dependency-path: web/package-lock.json
- name: Install dependencies
working-directory: web
run: |
npm ci
- name: Lint JavaScript
working-directory: web
run: |
npm run lint:javascript
lint-javascript-web-cypress:
name: JavaScript (web-cypress)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.web-cypress == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: web-cypress/.nvmrc
cache: npm
cache-dependency-path: web-cypress/package-lock.json
- name: Install dependencies
working-directory: web-cypress
run: |
npm ci
- name: Lint JavaScript
working-directory: web-cypress
run: |
npm run lint:javascript
lint-kotlin-mobile-android:
name: Kotlin (mobile-android)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.mobile-android == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Java
uses: actions/setup-java@v4.3.0
with:
distribution: corretto
java-version: '17'
cache: gradle
- name: Lint Kotlin
working-directory: mobile/mobile-android
run: |
./gradlew ktlintCheck
lint-kubernetes-manifest:
name: Kubernetes Manifest
needs: detect-changes
if: ${{ needs.detect-changes.outputs.kubernetes == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Lint Kubernetes
run: |
docker run \
--rm \
--volume="$(pwd)/kubernetes:/kubernetes" \
ghcr.io/yannh/kubeconform:latest-alpine \
-kubernetes-version=1.26.0 \
-ignore-filename-pattern='.*trafficsplit.yaml' \
-ignore-filename-pattern='.*my-values.yaml' \
-ignore-filename-pattern=kubernetes/manifests/argocd/ \
-ignore-filename-pattern=kubernetes/manifests/elastic/ \
-ignore-filename-pattern=kubernetes/manifests/hm-kafka/ \
-ignore-filename-pattern=kubernetes/manifests/kubeflow/kubeflow-training-operator/ \
-ignore-filename-pattern=kubernetes/manifests/postgres-operator/ \
-ignore-filename-pattern=kubernetes/manifests/prometheus/ \
-ignore-filename-pattern=kubernetes/manifests/yugabyte/ \
kubernetes/manifests/
lint-markdown:
name: Markdown
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: |
npm ci
- name: Lint Markdown
run: |
npm run lint:markdown
lint-matlab:
name: MATLAB
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Lint MATLAB
run: |
poetry run poe lint-matlab
lint-protocol-buffers-api-go:
name: Protocol Buffers (api-go)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.api-go == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Lint Protocol Buffers
working-directory: api-go
run: |
docker run \
--rm \
--volume="$(pwd):/workspace" \
--workdir=/workspace \
bufbuild/buf \
lint
lint-python:
name: Python
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Lint Python (Black)
run: |
poetry run poe lint-python-black
- name: Lint Python (Ruff)
run: |
poetry run poe lint-python-ruff
- name: Lint Python (isort)
run: |
poetry run poe lint-python-isort
lint-qml:
name: QML
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Qt
uses: jurplel/install-qt-action@v4.0.0
with:
version: 6.6.1
cache: true
- name: Lint QML
run: |
qmllint $(git ls-files "**/*.qml")
lint-ruby:
name: Ruby
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Lint Ruby
run: |
bundle exec rubocop
lint-scala-hm-spark-find-retired-people-scala:
name: Scala (hm-spark-find-retired-people-scala)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.hm-spark-find-retired-people-scala == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Java
uses: actions/setup-java@v4.3.0
with:
distribution: corretto
java-version: '17'
cache: sbt
- name: Lint Scala (Scalafmt)
working-directory: data-processing/hm-spark/applications/find-retired-people-scala
run: |
sbt scalafmtCheckAll
- name: Lint Scala (Scalafix)
working-directory: data-processing/hm-spark/applications/find-retired-people-scala
run: |
sbt "scalafixAll --check"
lint-scala-hm-spark-ingest-from-s3-to-kafka:
name: Scala (hm-spark-ingest-from-s3-to-kafka)
needs: detect-changes
if: ${{ needs.detect-changes.outputs.hm-spark-ingest-from-s3-to-kafka == 'true' }}
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Java
uses: actions/setup-java@v4.3.0
with:
distribution: corretto
java-version: '17'
cache: sbt
- name: Lint Scala (Scalafmt)
working-directory: data-processing/hm-spark/applications/ingest-from-s3-to-kafka
run: |
sbt scalafmtCheckAll
- name: Lint Scala (Scalafix)
working-directory: data-processing/hm-spark/applications/ingest-from-s3-to-kafka
run: |
sbt "scalafixAll --check"
lint-shell:
name: Shell
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Lint Shell
run: |
shellcheck $(git ls-files '**/*.sh')
lint-solidity:
name: Solidity
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: |
npm ci
- name: Lint Solidity
run: |
npm run lint:solidity
lint-sql:
name: SQL
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Lint SQL
run: |
# poetry run poe lint-sql -- --dialect=athena cloud-platform/aws/amazon-athena/queries
# poetry run poe lint-sql -- --dialect=bigquery cloud-platform/google-cloud/bigquery/bigquery-ml
# poetry run poe lint-sql -- --dialect=clickhouse data-storage/clickhouse/cpu_metrics
poetry run poe lint-sql -- --dialect=postgres hasura-graphql-engine/migrations
poetry run poe lint-sql -- --dialect=postgres hasura-graphql-engine/seeds
poetry run poe lint-sql -- --dialect=postgres kubernetes/data/postgres/opa_db/migrations
poetry run poe lint-sql -- --dialect=postgres data-ingestion/airbyte/sources/postgres/production-iot
poetry run poe lint-sql -- --dialect=postgres data-processing/flink/applications/stream-tweets/migrations
poetry run poe lint-sql -- --dialect=postgres data-storage/timescaledb/dummy_iot/migrations
poetry run poe lint-sql -- --dialect=postgres data-storage/timescaledb/motor/migrations
# poetry run poe lint-sql -- --dialect=postgres ops/argo-cd/applications/production-hm/airbyte/sql
# poetry run poe lint-sql -- --dialect=snowflake data-storage/snowflake/queries
poetry run poe lint-sql -- --dialect=sparksql data-storage/delta-lake/queries
poetry run poe lint-sql -- --dialect=sqlite data-storage/sqlite/queries
# poetry run poe lint-sql -- --dialect=trino trino/queries
poetry run poe lint-sql -- --dialect=tsql data-storage/microsoft-sql-server/queries
lint-terraform:
name: Terraform
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
- name: Lint Terraform
run: |
terraform fmt -recursive -check
lint-vhdl:
name: VHDL
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Lint VHDL
run: |
poetry run poe lint-vhdl
lint-xml:
name: XML
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Set up Node.js
uses: actions/setup-node@v4.0.4
with:
node-version-file: .nvmrc
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: |
npm ci
- name: Lint XML
run: |
npm run lint:xml
lint-yaml:
name: YAML
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.1.7
- name: Install Poetry
run: |
pipx install poetry
- name: Set up Python
uses: actions/setup-python@v5.2.0
with:
python-version-file: pyproject.toml
cache: poetry
cache-dependency-path: poetry.lock
- name: Install dependencies
run: |
poetry install
- name: Lint YAML
run: |
poetry run poe lint-yaml