-
-
Notifications
You must be signed in to change notification settings - Fork 103
45 lines (42 loc) · 1.06 KB
/
linting.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
name: Linting
on: pull_request
jobs:
swiftformat:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Installing packages
run: |
brew update
if brew ls --version swiftformat > /dev/null; then
brew upgrade swiftformat
else
brew install swiftformat
fi
- name: Formatting code
run: |
swiftformat --lint .
swiftlint:
runs-on: macos-12
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: '2.7'
bundler-cache: true
- name: Installing packages
run: |
brew update
if brew ls --version swiftlint > /dev/null; then
brew upgrade swiftlint
else
# For some reason the SwiftLint binary is kept at its location after shutdown.
brew install swiftlint || brew link --overwrite swiftlint
fi
- name: Linting code
run: |
swiftlint --strict