Skip to content

build(ci): run SwiftLint on pull requests - #59

Merged
futamura merged 1 commit into
developfrom
build/ci-swiftlint
Aug 21, 2026
Merged

build(ci): run SwiftLint on pull requests#59
futamura merged 1 commit into
developfrom
build/ci-swiftlint

Conversation

@futamura

Copy link
Copy Markdown
Owner

目的

Hound integration 削除 (#58) 以降、PR 時の自動 lint が存在しなかった。ci.yml の job test は Fastlane を経由せず xcodebuild を直接叩くため、SwiftLint は lint lane の手動実行でしか走らない状態だった (#40)。

主要変更点

  • .github/workflows/ci.yml に job lint を追加。ubuntu-latest 上で jdx/mise-action@v4 (install_args: swiftlint) を使い、.mise.toml に pin した SwiftLint 0.63.2 を導入する。local と CI で同一 binary。
  • .swiftlint-baseline.json を追加。現状の 112 warnings / 0 serious を凍結する。
  • lint は --strict で実行し、新規違反のみ fail させる。既存コードには手を入れない。
  • --reporter github-actions-logging により違反が PR diff 上に inline annotation として出る。
  • fastlane/Fastfile: lint lane を CI と同一の invocation へ更新し、baseline 再生成用の lint_baseline lane を追加。
  • .swiftlint.yml: identifier_namedisabled_rules に入っているため、設定 block は毎回 warning: Found a configuration for 'identifier_name' rule, but it is disabled を出すだけだった。block を削除 (挙動は不変)。

Verification

gate 結果
git diff --check exit 0
ci.yml YAML parse jobs = lint, testtest の check context / steps 9 件は不変
bundle exec fastlane ios lint exit 0 / 違反 0
新規違反 probe (force_cast を含む一時 file) exit 2 / error: Force Cast Violation を検出。probe は削除済み
baseline 内容 112 entries / 26 files / 全て Sources/ 相対 path (絶対 path 0)
CI job lint この PR の run で確認

UI 変更なし。transition / layout / gesture / animation / Storyboard に非該当のため Simulator 確認は対象外。

補足

lint の required check 化は本 PR では行わない。job が green と確認できた後、main-protection ruleset の required_status_checks へ追加するかを別途判断する。

関連: #40

CI had no lint step since the Hound integration was removed: ci.yml
drives xcodebuild directly and never reached the Fastlane lint lane, so
style violations were only caught by running SwiftLint by hand.

Add a lint job to ci.yml. It runs on ubuntu-latest and installs the
SwiftLint version pinned in .mise.toml through mise-action, so CI and
local runs use the same binary.

The 135 sources currently hold 112 warnings and 0 serious violations.
Freeze them in .swiftlint-baseline.json and lint with --strict so the
job fails on new violations while the existing ones stay untouched. The
lint lane matches that invocation, and a lint_baseline lane regenerates
the file.

Also drop the identifier_name settings from .swiftlint.yml. The rule is
in disabled_rules, so the block only produced a warning on every run.
@futamura
futamura merged commit 76ec132 into develop Aug 21, 2026
3 of 4 checks passed
@futamura
futamura deleted the build/ci-swiftlint branch August 21, 2026 01:11
futamura added a commit that referenced this pull request Aug 21, 2026
UIKitSpec's "prepares blurred snapshots before becoming visible" waited
only 0.5 seconds for the blurred image and failed on CI in PRs #47, #58
and #59. A rerun of the same commit passed every time.

FluidBlurredBackgroundView produces the image across two async hops:
blurQueue runs CIGaussianBlur, then the main queue assigns
blurView.image. A loaded runner does not always finish both within
0.5s. This was the only tight timeout in the suite; the other five
call sites use the 10 second default and have never flaked.

Drop the override so the test uses that default, and assert visibility
and alpha again after the wait. The claim the test makes, that the
snapshot is prepared while the view is invisible, now rests on those
assertions instead of on how long the wait happened to be.
@futamura futamura mentioned this pull request Aug 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant