Rely on SPM plugins to consume SwiftLint and SwiftFormat

Use their latest releases and fix some violations and issues.

# Conflicts:
#	.github/workflows/linting.yml
#	.github/workflows/testing.yml
This commit is contained in:
Danny Mösch 2024-11-24 13:14:38 +01:00
parent 358908f161
commit 1bdf9d684b
40 changed files with 126 additions and 186 deletions

View file

@ -21,9 +21,8 @@ jobs:
- name: Installing packages
run: |
brew update
brew install carthage swiftformat
brew install carthage
brew install go || brew link --overwrite go
brew install swiftlint || brew link --overwrite swiftlint
gem install bundler
- uses: actions/cache@v3
id: carthage-cache

View file

@ -1,45 +0,0 @@
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

View file

@ -14,9 +14,8 @@ jobs:
- name: Installing packages
run: |
brew update
brew install carthage swiftformat
brew install go@1.20 || brew link --overwrite go
brew install swiftlint || brew link --overwrite swiftlint
brew install carthage
brew install go || brew link --overwrite go
gem install bundler
- uses: actions/cache@v3
id: carthage-cache