mirror of
https://github.com/xtool-org/xtool.git
synced 2026-11-16 20:41:53 +03:00
Better swiftlint
This commit is contained in:
@@ -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/' \
|
||||
|
||||
@@ -12,3 +12,4 @@ DerivedData/
|
||||
.docc-build
|
||||
|
||||
/openapi
|
||||
/.swiftlint
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
swiftlint_version: 0.59.1
|
||||
disabled_rules:
|
||||
- trailing_comma
|
||||
- nesting
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+1
-10
@@ -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",
|
||||
|
||||
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user