forked from canonical/microk8s-community-addons
-
Notifications
You must be signed in to change notification settings - Fork 1
35 lines (31 loc) · 979 Bytes
/
check-formatting.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
name: Lint Code
on:
- push
- pull_request
jobs:
check-formatting:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install python3-setuptools
sudo pip3 install black codespell
sudo snap install node --classic
sudo npm install --save-dev --save-exact -g prettier
- name: Check Python formatting
run: |
set -eux
black --check .
codespell --ignore-words-list="aks" --quiet-level=2
- name: Check YAML formatting
run: |
set -eux
prettier --check $(find . -name "*.yaml" -o -name "*.yml" \
| grep -v "./addons/ingress/ingress.yaml" \
| grep -v "./addons/metallb/metallb.yaml" \
| grep -v "./addons/nfs/nfs.yaml" \
| grep -v "templates")