ci: add swiftlint/swiftformat for mac app
This commit is contained in:
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@@ -56,12 +56,22 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install SwiftLint / SwiftFormat
|
||||
run: |
|
||||
brew install swiftlint swiftformat
|
||||
|
||||
- name: Show toolchain
|
||||
run: |
|
||||
sw_vers
|
||||
xcodebuild -version
|
||||
swift --version
|
||||
|
||||
- name: SwiftLint
|
||||
run: swiftlint --config .swiftlint.yml
|
||||
|
||||
- name: SwiftFormat (lint mode)
|
||||
run: swiftformat --lint apps/macos/Sources --config .swiftformat
|
||||
|
||||
- name: Swift build (release)
|
||||
run: swift build --package-path apps/macos --configuration release
|
||||
|
||||
|
||||
12
.swiftformat
Normal file
12
.swiftformat
Normal file
@@ -0,0 +1,12 @@
|
||||
--swiftversion 5.10
|
||||
--indent 4
|
||||
--decimalgrouping none
|
||||
--hexgrouping none
|
||||
--wraparguments after-first
|
||||
--wrapcollections before-first
|
||||
--trimwhitespace always
|
||||
--stripunusedargs closure-only
|
||||
--stripunusedimports
|
||||
--self init-only
|
||||
--disable redundantSelf
|
||||
--enable wrapMultilineStatementBraces
|
||||
20
.swiftlint.yml
Normal file
20
.swiftlint.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
included:
|
||||
- apps/macos/Sources
|
||||
|
||||
excluded:
|
||||
- apps/macos/Tests
|
||||
|
||||
disabled_rules:
|
||||
- trailing_whitespace
|
||||
- todo
|
||||
- line_length
|
||||
- identifier_name
|
||||
- type_body_length
|
||||
- file_length
|
||||
|
||||
opt_in_rules:
|
||||
- explicit_self
|
||||
- implicit_return
|
||||
- vertical_whitespace_between_cases
|
||||
|
||||
reporter: "xcode"
|
||||
Reference in New Issue
Block a user