diff --git a/.github/workflows/swiftlint.yml b/.github/workflows/swiftlint.yml index 9e3032cc..3cfb5bb2 100644 --- a/.github/workflows/swiftlint.yml +++ b/.github/workflows/swiftlint.yml @@ -12,15 +12,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - name: Install SwiftLint - run: | - curl -fSLO https://github.com/realm/SwiftLint/releases/download/0.59.1/swiftlint_linux.zip - unzip swiftlint_linux.zip swiftlint -d /usr/local/bin - rm swiftlint_linux.zip - name: Lint # based on https://github.com/norio-nomura/action-swiftlint run: | - swiftlint \ + make lint \ | sed -E \ -e "s/$(pwd|sed 's/\//\\\//g')\///" \ -e 's/^(.*):([0-9]+):([0-9]+): (warning|error|[^:]+): (.*)/::\4 file=\1,line=\2,col=\3::\5/' \ diff --git a/.gitignore b/.gitignore index 590a95c6..b1a772b9 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ DerivedData/ .docc-build /openapi +/.swiftlint diff --git a/.swiftlint.yml b/.swiftlint.yml index 66edde7e..ddd0ab04 100644 --- a/.swiftlint.yml +++ b/.swiftlint.yml @@ -1,3 +1,4 @@ +swiftlint_version: 0.59.1 disabled_rules: - trailing_comma - nesting diff --git a/Makefile b/Makefile index edcecedb..3fa76812 100644 --- a/Makefile +++ b/Makefile @@ -126,9 +126,21 @@ docs: docs-preview: ./Documentation/build.sh preview +SWIFTLINT_VERSION = $(shell head -1 .swiftlint.yml | cut -d' ' -f2) +SWIFTLINT_BIN = .swiftlint/swiftlint-$(SWIFTLINT_VERSION) +SWIFTLINT_URL = https://github.com/realm/SwiftLint/releases/download/$(SWIFTLINT_VERSION)/$(if $(IS_MAC),portable_swiftlint,swiftlint_linux).zip + .PHONY: lint -lint: - swift package plugin --allow-writing-to-package-directory swiftlint +lint: $(SWIFTLINT_BIN) + $(SWIFTLINT_BIN) + +$(SWIFTLINT_BIN): + @rm -rf .swiftlint + @mkdir -p .swiftlint + curl -fSL $(SWIFTLINT_URL) -o .swiftlint/swiftlint.zip + unzip -q .swiftlint/swiftlint.zip swiftlint -d .swiftlint + rm -f .swiftlint/swiftlint.zip + mv .swiftlint/swiftlint $@ SPEC_URL = https://developer.apple.com/sample-code/app-store-connect/app-store-connect-openapi-specification.zip diff --git a/Package.resolved b/Package.resolved index a09c6333..dbef737a 100644 --- a/Package.resolved +++ b/Package.resolved @@ -1,5 +1,5 @@ { - "originHash" : "5cb26d4cfe9e9240988f3a6c406b8a8b8ab226607c2c80a29f72214e0a48fdb6", + "originHash" : "d08ba8535e09303ac5be5621b8aea1a2409ebcb2ab566d661a63ec8ab5825189", "pins" : [ { "identity" : "aexml", @@ -334,15 +334,6 @@ "version" : "6.0.3" } }, - { - "identity" : "swiftlintplugins", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SimplyDanny/SwiftLintPlugins", - "state" : { - "revision" : "8545ddf4de043e6f2051c5cf204f39ef778ebf6b", - "version" : "0.59.1" - } - }, { "identity" : "swiftymobiledevice", "kind" : "remoteSourceControl", diff --git a/Package.swift b/Package.swift index 08d4ca2b..b7a293e3 100644 --- a/Package.swift +++ b/Package.swift @@ -62,8 +62,6 @@ let package = Package( .package(url: "https://github.com/pointfreeco/swift-concurrency-extras", from: "1.3.0"), .package(url: "https://github.com/pointfreeco/swift-dependencies", from: "1.6.2"), - .package(url: "https://github.com/SimplyDanny/SwiftLintPlugins", exact: "0.59.1"), - .package(url: "https://github.com/attaswift/BigInt", from: "5.5.0"), .package(url: "https://github.com/mxcl/Version", from: "2.1.0"), .package(url: "https://github.com/jpsim/Yams", from: "5.1.3"),