Update SwiftLint and SwiftFormat #142
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |