Skip to content

Commit 1f2f485

Browse files
committed
chore: add package standardization
- Add comprehensive .gitignore with AI-generated .md exclusions - Add CI/CD workflows (ci.yml, swift-format.yml, swiftlint.yml) - Add dependabot configuration for automated dependency updates - Add .swift-format configuration (Point-Free style, 4 spaces) - Add .swiftlint.yml configuration All configuration follows standardization checklist requirements
1 parent b6dcfc2 commit 1f2f485

File tree

7 files changed

+241
-6
lines changed

7 files changed

+241
-6
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "swift"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
workflow_dispatch:
11+
12+
concurrency:
13+
group: ci-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
# Primary development workflow: Latest Swift on macOS with debug build
18+
macos-latest:
19+
name: macOS (Swift 6.2, debug)
20+
runs-on: macos-26
21+
steps:
22+
- uses: actions/checkout@v5
23+
24+
- name: Select Xcode 26.0
25+
run: sudo xcode-select -s /Applications/Xcode_26.0.app
26+
27+
- name: Print Swift version
28+
run: swift --version
29+
30+
- name: Cache Swift packages
31+
uses: actions/cache@v4
32+
with:
33+
path: .build
34+
key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift') }}
35+
restore-keys: |
36+
${{ runner.os }}-spm-
37+
38+
# Note: swift test builds automatically, no separate build step needed
39+
- name: Test
40+
run: swift test -c debug
41+
42+
- name: Validate Package.swift
43+
run: swift package dump-package
44+
45+
- name: Check for API breaking changes
46+
run: swift package diagnose-api-breaking-changes --breakage-allowlist-path .swift-api-breakage-allowlist || true
47+
continue-on-error: true
48+
49+
# Production validation: Latest Swift on Linux with release build
50+
linux-latest:
51+
name: Ubuntu (Swift 6.2, release)
52+
runs-on: ubuntu-latest
53+
container: swift:6.2
54+
steps:
55+
- uses: actions/checkout@v5
56+
57+
- name: Cache Swift packages
58+
uses: actions/cache@v4
59+
with:
60+
path: .build
61+
key: ${{ runner.os }}-spm-${{ hashFiles('Package.swift') }}
62+
restore-keys: ${{ runner.os }}-spm-
63+
64+
# Note: swift test builds automatically in release mode
65+
- name: Test (release)
66+
run: swift test -c release
67+
68+
# Compatibility check: Minimum supported Swift version (6.1)
69+
linux-compat:
70+
name: Ubuntu (Swift 6.1, compatibility)
71+
runs-on: ubuntu-latest
72+
container: swift:6.1
73+
steps:
74+
- uses: actions/checkout@v5
75+
76+
- name: Cache Swift packages
77+
uses: actions/cache@v4
78+
with:
79+
path: .build
80+
key: ${{ runner.os }}-swift61-spm-${{ hashFiles('Package.swift') }}
81+
restore-keys: ${{ runner.os }}-swift61-spm-
82+
83+
# Note: swift test builds automatically
84+
- name: Test (Swift 6.1)
85+
run: swift test -c release

.github/workflows/swift-format.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Swift Format
2+
on:
3+
push:
4+
branches: [main]
5+
6+
jobs:
7+
format:
8+
runs-on: macos-26
9+
steps:
10+
- uses: actions/checkout@v5
11+
- name: Format code
12+
run: swift-format format --recursive --in-place Sources Tests
13+
- name: Commit changes
14+
uses: stefanzweifel/git-auto-commit-action@v7
15+
with:
16+
commit_message: "Run swift-format"

.github/workflows/swiftlint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: SwiftLint
2+
on:
3+
pull_request:
4+
branches: [main]
5+
6+
jobs:
7+
lint:
8+
runs-on: macos-26
9+
steps:
10+
- uses: actions/checkout@v5
11+
- name: SwiftLint
12+
run: swiftlint lint
13+
continue-on-error: true

.gitignore

Lines changed: 50 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,52 @@
1-
.DS_Store
2-
/.build
3-
/Packages
4-
/*.xcodeproj
5-
xcuserdata/
6-
DerivedData/
1+
# Swift
2+
.build/
73
.swiftpm/
84
Package.resolved
5+
6+
# Environment files
7+
.env*
8+
9+
# Xcode
10+
*.xcodeproj
11+
*.xcworkspace
12+
*.xcuserdata
13+
DerivedData/
14+
15+
# IDEs
16+
.vscode/
17+
.idea/
18+
*.swp
19+
*.swo
20+
*~
21+
22+
# Generated by MacOS
23+
.DS_Store
24+
25+
# Generated by Windows
26+
Thumbs.db
27+
28+
# Generated by Linux
29+
*~
30+
31+
# Log files
32+
*.log
33+
34+
# AI assistant files
35+
.claude/
36+
CLAUDE.md
37+
CLAUDE.MD
38+
39+
# Documentation (opt-in for top-level .md files only)
40+
/*.md
41+
!README.md
42+
!LICENSE.md
43+
!CHANGELOG.md
44+
!CONTRIBUTING.md
45+
!CODE_OF_CONDUCT.md
46+
!SECURITY.md
47+
48+
# Temporary files
49+
*.tmp
50+
*.temp
51+
52+
.swift-version

.swift-format

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
{
2+
"version": 1,
3+
"lineLength": 100,
4+
"indentation": {
5+
"spaces": 4
6+
},
7+
"tabWidth": 8,
8+
"maximumBlankLines": 1,
9+
"respectsExistingLineBreaks": true,
10+
"lineBreakBeforeControlFlowKeywords": false,
11+
"lineBreakBeforeEachArgument": true,
12+
"lineBreakBeforeEachGenericRequirement": false,
13+
"prioritizeKeepingFunctionOutputTogether": true,
14+
"indentConditionalCompilationBlocks": true,
15+
"lineBreakAroundMultilineExpressionChainComponents": false,
16+
"fileScopedDeclarationPrivacy": {
17+
"accessLevel": "private"
18+
},
19+
"rules": {
20+
"AllPublicDeclarationsHaveDocumentation": false,
21+
"AlwaysUseLowerCamelCase": true,
22+
"AmbiguousTrailingClosureOverload": true,
23+
"BeginDocumentationCommentWithOneLineSummary": false,
24+
"DoNotUseSemicolons": true,
25+
"DontRepeatTypeInStaticProperties": true,
26+
"FileScopedDeclarationPrivacy": true,
27+
"FullyIndirectEnum": true,
28+
"GroupNumericLiterals": true,
29+
"IdentifiersMustBeASCII": true,
30+
"NeverForceUnwrap": false,
31+
"NeverUseForceTry": false,
32+
"NeverUseImplicitlyUnwrappedOptionals": false,
33+
"NoAccessLevelOnExtensionDeclaration": true,
34+
"NoBlockComments": true,
35+
"NoCasesWithOnlyFallthrough": true,
36+
"NoEmptyTrailingClosureParentheses": true,
37+
"NoLabelsInCasePatterns": true,
38+
"NoLeadingUnderscores": false,
39+
"NoParensAroundConditions": true,
40+
"NoVoidReturnOnFunctionSignature": true,
41+
"OneCasePerLine": true,
42+
"OneVariableDeclarationPerLine": true,
43+
"OnlyOneTrailingClosureArgument": true,
44+
"OrderedImports": true,
45+
"ReturnVoidInsteadOfEmptyTuple": true,
46+
"UseLetInEveryBoundCaseVariable": true,
47+
"UseShorthandTypeNames": true,
48+
"UseSingleLinePropertyGetter": true,
49+
"UseSynthesizedInitializer": true,
50+
"UseTripleSlashForDocumentationComments": true,
51+
"UseWhereClausesInForLoops": false,
52+
"ValidateDocumentationComments": false
53+
}
54+
}

.swiftlint.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
disabled_rules:
2+
- line_length
3+
- function_body_length
4+
- type_body_length
5+
- file_length
6+
opt_in_rules:
7+
- explicit_init
8+
- explicit_type_interface
9+
included:
10+
- Sources
11+
- Tests
12+
excluded:
13+
- .build

0 commit comments

Comments
 (0)