Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit ad2e835

Browse files
authored
Tooling: Define SwiftLint version and run on CI (#735)
2 parents b2fd35f + ac2a933 commit ad2e835

File tree

6 files changed

+31
-10
lines changed

6 files changed

+31
-10
lines changed

.buildkite/pipeline.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Nodes with values to reuse in the pipeline.
22
common_params:
33
plugins: &common_plugins
4-
- automattic/a8c-ci-toolkit#3.0.1
4+
- automattic/a8c-ci-toolkit#3.1.0
55
# Common environment values to use with the `env` key.
66
env: &common_env
77
IMAGE_ID: xcode-15.0.1
@@ -33,8 +33,17 @@ steps:
3333
plugins: *common_plugins
3434

3535
#################
36-
# Lint
36+
# Linters
3737
#################
38+
- label: ":swift: SwiftLint"
39+
command: run_swiftlint --strict
40+
plugins: *common_plugins
41+
notify:
42+
- github_commit_status:
43+
context: "SwiftLint"
44+
agents:
45+
queue: "default"
46+
3847
- label: "🧹 Lint"
3948
key: "lint"
4049
command: |

.rubocop.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22
AllCops:
33
NewCops: enable
44

5+
# Override the maximum line length
6+
Layout/LineLength:
7+
Max: 160
8+
59
# Allow the Podspec filename to match the project
610
Naming/FileName:
711
Exclude:
812
- 'WordPressKit.podspec'
913

10-
# Override the maximum line length
11-
Layout/LineLength:
12-
Max: 160
14+
Metrics/BlockLength:
15+
Exclude:
16+
- 'fastlane/Fastfile'

.swiftlint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
swiftlint_version: 0.54.0
2+
13
parent_config: https://raw.githubusercontent.com/Automattic/swiftlint-config/0f8ab6388bd8d15a04391825ab125f80cfb90704/.swiftlint.yml
24
remote_timeout: 10.0
35

Podfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ APP_IOS_DEPLOYMENT_TARGET = Gem::Version.new('13.0')
99

1010
platform :ios, APP_IOS_DEPLOYMENT_TARGET
1111

12+
def swiftlint_version
13+
require 'yaml'
14+
15+
YAML.load_file('.swiftlint.yml')['swiftlint_version']
16+
end
17+
1218
def wordpresskit_pods
1319
pod 'Alamofire', '~> 4.8.0'
1420
pod 'WordPressShared', '~> 2.0.0-beta.2'
@@ -35,7 +41,7 @@ target 'WordPressKitTests' do
3541
end
3642

3743
abstract_target 'Tools' do
38-
pod 'SwiftLint', '~> 0.54'
44+
pod 'SwiftLint', swiftlint_version
3945
end
4046

4147
# Let Pods targets inherit deployment target from the app

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ DEPENDENCIES:
2828
- OCMock (~> 3.4)
2929
- OHHTTPStubs (~> 9.0)
3030
- OHHTTPStubs/Swift (~> 9.0)
31-
- SwiftLint (~> 0.54)
31+
- SwiftLint (= 0.54.0)
3232
- UIDeviceIdentifier (~> 2.0)
3333
- WordPressShared (~> 2.0.0-beta.2)
3434
- wpxmlrpc (~> 0.10.0)
@@ -54,6 +54,6 @@ SPEC CHECKSUMS:
5454
WordPressShared: f93f99269258b46dad04f4e4dbf540ce2e5c1e66
5555
wpxmlrpc: 68db063041e85d186db21f674adf08d9c70627fd
5656

57-
PODFILE CHECKSUM: 9ca3a8756de542f45541c503cc23e3166b215206
57+
PODFILE CHECKSUM: a06b4d2f7183f40a91a0f219ca399141aee28c5f
5858

5959
COCOAPODS: 1.14.3

fastlane/Fastfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
default_platform(:ios)
44

5-
platform :ios do
6-
SWIFTLINT_PATH = './Pods/SwiftLint/swiftlint'
5+
SWIFTLINT_PATH = './Pods/SwiftLint/swiftlint'
76

7+
platform :ios do
88
lane :lint do
99
swiftlint(
1010
executable: SWIFTLINT_PATH,

0 commit comments

Comments
 (0)