Skip to content

Commit bb7c46c

Browse files
authored
Claude refactor (#104)
1 parent 92f6766 commit bb7c46c

53 files changed

Lines changed: 5226 additions & 2192 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.devcontainer/devcontainer.json

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "Swift 6.1",
3+
"image": "swift:6.1",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"upgradePackages": "false"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "os-provided",
12+
"ppa": "false"
13+
}
14+
},
15+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
"customizations": {
22+
"vscode": {
23+
"settings": {
24+
"lldb.library": "/usr/lib/liblldb.so"
25+
},
26+
"extensions": [
27+
"sswg.swift-lang"
28+
]
29+
}
30+
},
31+
"remoteUser": "root"
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "Swift 6.0",
3+
"image": "swift:6.0",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"upgradePackages": "false"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "os-provided",
12+
"ppa": "false"
13+
}
14+
},
15+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
"customizations": {
22+
"vscode": {
23+
"settings": {
24+
"lldb.library": "/usr/lib/liblldb.so"
25+
},
26+
"extensions": [
27+
"sswg.swift-lang"
28+
]
29+
}
30+
},
31+
"remoteUser": "root"
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "Swift 6.1 Nightly",
3+
"image": "swiftlang/swift:nightly-6.1-noble",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"upgradePackages": "false"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "os-provided",
12+
"ppa": "false"
13+
}
14+
},
15+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
"customizations": {
22+
"vscode": {
23+
"settings": {
24+
"lldb.library": "/usr/lib/liblldb.so"
25+
},
26+
"extensions": [
27+
"sswg.swift-lang"
28+
]
29+
}
30+
},
31+
"remoteUser": "root"
32+
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"name": "Swift 6.1",
3+
"image": "swift:6.1",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"upgradePackages": "false"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "os-provided",
12+
"ppa": "false"
13+
}
14+
},
15+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
"customizations": {
22+
"vscode": {
23+
"settings": {
24+
"lldb.library": "/usr/lib/liblldb.so"
25+
},
26+
"extensions": [
27+
"sswg.swift-lang"
28+
]
29+
}
30+
},
31+
"remoteUser": "root"
32+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Swift 6.2 Nightly",
3+
"image": "swiftlang/swift:nightly-6.2-noble",
4+
"features": {
5+
"ghcr.io/devcontainers/features/common-utils:2": {
6+
"installZsh": "false",
7+
"username": "vscode",
8+
"upgradePackages": "false"
9+
},
10+
"ghcr.io/devcontainers/features/git:1": {
11+
"version": "os-provided",
12+
"ppa": "false"
13+
}
14+
},
15+
"postStartCommand": "git config --global --add safe.directory ${containerWorkspaceFolder}",
16+
"runArgs": [
17+
"--cap-add=SYS_PTRACE",
18+
"--security-opt",
19+
"seccomp=unconfined"
20+
],
21+
// Configure tool-specific properties.
22+
"customizations": {
23+
// Configure properties specific to VS Code.
24+
"vscode": {
25+
// Set *default* container specific settings.json values on container create.
26+
"settings": {
27+
"lldb.library": "/usr/lib/liblldb.so"
28+
},
29+
// Add the IDs of extensions you want installed when the container is created.
30+
"extensions": [
31+
"sswg.swift-lang"
32+
]
33+
}
34+
},
35+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
36+
// "forwardPorts": [],
37+
38+
// Set `remoteUser` to `root` to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
39+
"remoteUser": "root"
40+
}

.github/workflows/MistKit.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: MistKit
2+
on:
3+
push:
4+
branches-ignore:
5+
- '*WIP'
6+
env:
7+
PACKAGE_NAME: MistKit
8+
jobs:
9+
build-ubuntu:
10+
name: Build on Ubuntu
11+
runs-on: ubuntu-latest
12+
container: ${{ matrix.swift.nightly && format('swiftlang/swift:nightly-{0}-{1}', matrix.swift.version, matrix.os) || format('swift:{0}-{1}', matrix.swift.version, matrix.os) }}
13+
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
14+
strategy:
15+
matrix:
16+
os: [noble, jammy]
17+
swift:
18+
- version: "6.0"
19+
- version: "6.1"
20+
- version: "6.1"
21+
nightly: true
22+
- version: "6.2"
23+
nightly: true
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: brightdigit/swift-build@v1.2.0
28+
- uses: sersoft-gmbh/swift-coverage-action@v4
29+
id: coverage-files
30+
with:
31+
fail-on-empty-output: true
32+
- name: Upload coverage to Codecov
33+
uses: codecov/codecov-action@v4
34+
with:
35+
fail_ci_if_error: true
36+
flags: swift-${{ matrix.swift.version }}-${{ matrix.os }}${{ matrix.swift.nightly && 'nightly' || '' }}
37+
verbose: true
38+
token: ${{ secrets.CODECOV_TOKEN }}
39+
files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}
40+
build-macos:
41+
name: Build on macOS
42+
env:
43+
PACKAGE_NAME: MistKit
44+
runs-on: ${{ matrix.runs-on }}
45+
if: "!contains(github.event.head_commit.message, 'ci skip')"
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
include:
50+
# SPM Build Matrix
51+
- runs-on: macos-15
52+
xcode: "/Applications/Xcode_26.0.app"
53+
- runs-on: macos-15
54+
xcode: "/Applications/Xcode_16.4.app"
55+
- runs-on: macos-15
56+
xcode: "/Applications/Xcode_16.3.app"
57+
- runs-on: macos-15
58+
xcode: "/Applications/Xcode_16.2.app"
59+
60+
# macOS Build Matrix
61+
- type: macos
62+
runs-on: macos-15
63+
xcode: "/Applications/Xcode_16.4.app"
64+
65+
# iOS Build Matrix
66+
- type: ios
67+
runs-on: macos-15
68+
xcode: "/Applications/Xcode_26.0.app"
69+
deviceName: "iPhone 16 Pro"
70+
osVersion: "26.0"
71+
download-platform: true
72+
73+
- type: ios
74+
runs-on: macos-15
75+
xcode: "/Applications/Xcode_16.4.app"
76+
deviceName: "iPhone 16"
77+
osVersion: "18.5"
78+
79+
- type: ios
80+
runs-on: macos-15
81+
xcode: "/Applications/Xcode_16.3.app"
82+
deviceName: "iPhone 16"
83+
osVersion: "18.4"
84+
85+
- type: ios
86+
runs-on: macos-15
87+
xcode: "/Applications/Xcode_16.2.app"
88+
deviceName: "iPhone 16"
89+
osVersion: "18.3.1"
90+
download-platform: true
91+
92+
# watchOS Build Matrix
93+
- type: watchos
94+
runs-on: macos-15
95+
xcode: "/Applications/Xcode_16.4.app"
96+
deviceName: "Apple Watch Ultra 2 (49mm)"
97+
osVersion: "11.5"
98+
99+
# tvOS Build Matrix
100+
- type: tvos
101+
runs-on: macos-15
102+
xcode: "/Applications/Xcode_16.4.app"
103+
deviceName: "Apple TV"
104+
osVersion: "18.5"
105+
106+
# visionOS Build Matrix
107+
- type: visionos
108+
runs-on: macos-15
109+
xcode: "/Applications/Xcode_16.4.app"
110+
deviceName: "Apple Vision Pro"
111+
osVersion: "2.5"
112+
113+
steps:
114+
- uses: actions/checkout@v4
115+
116+
- name: Build and Test
117+
uses: brightdigit/swift-build@v1.2.0
118+
with:
119+
scheme: ${{ env.PACKAGE_NAME }}
120+
type: ${{ matrix.type }}
121+
xcode: ${{ matrix.xcode }}
122+
deviceName: ${{ matrix.deviceName }}
123+
osVersion: ${{ matrix.osVersion }}
124+
download-platform: ${{ matrix.download-platform }}
125+
126+
# Common Coverage Steps
127+
- name: Process Coverage
128+
uses: sersoft-gmbh/swift-coverage-action@v4
129+
130+
- name: Upload Coverage
131+
uses: codecov/codecov-action@v4
132+
with:
133+
token: ${{ secrets.CODECOV_TOKEN }}
134+
flags: ${{ matrix.type && format('{0}{1}', matrix.type, matrix.osVersion) || 'spm' }}
135+
136+
lint:
137+
name: Linting
138+
if: "!contains(github.event.head_commit.message, 'ci skip')"
139+
runs-on: ubuntu-latest
140+
needs: [build-ubuntu, build-macos]
141+
env:
142+
MINT_PATH: .mint/lib
143+
MINT_LINK_PATH: .mint/bin
144+
steps:
145+
- uses: actions/checkout@v4
146+
- name: Cache mint
147+
id: cache-mint
148+
uses: actions/cache@v4
149+
env:
150+
cache-name: cache
151+
with:
152+
path: |
153+
.mint
154+
Mint
155+
key: ${{ runner.os }}-mint-${{ hashFiles('**/Mintfile') }}
156+
restore-keys: |
157+
${{ runner.os }}-mint-
158+
- name: Install mint
159+
if: steps.cache-mint.outputs.cache-hit == ''
160+
run: |
161+
git clone https://github.com/yonaskolb/Mint.git
162+
cd Mint
163+
swift run mint install yonaskolb/mint
164+
- name: Lint
165+
run: ./Scripts/lint.sh
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Claude Code Review
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize]
6+
# Optional: Only run on specific file changes
7+
# paths:
8+
# - "src/**/*.ts"
9+
# - "src/**/*.tsx"
10+
# - "src/**/*.js"
11+
# - "src/**/*.jsx"
12+
13+
jobs:
14+
claude-review:
15+
# Optional: Filter by PR author
16+
# if: |
17+
# github.event.pull_request.user.login == 'external-contributor' ||
18+
# github.event.pull_request.user.login == 'new-developer' ||
19+
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
20+
21+
runs-on: ubuntu-latest
22+
permissions:
23+
contents: read
24+
pull-requests: read
25+
issues: read
26+
id-token: write
27+
28+
steps:
29+
- name: Checkout repository
30+
uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 1
33+
34+
- name: Run Claude Code Review
35+
id: claude-review
36+
uses: anthropics/claude-code-action@v1
37+
with:
38+
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
39+
prompt: |
40+
Please review this pull request and provide feedback on:
41+
- Code quality and best practices
42+
- Potential bugs or issues
43+
- Performance considerations
44+
- Security concerns
45+
- Test coverage
46+
47+
Use the repository's CLAUDE.md for guidance on style and conventions. Be constructive and helpful in your feedback.
48+
49+
Use `gh pr comment` with your Bash tool to leave your review as a comment on the PR.
50+
51+
# See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
52+
# or https://docs.anthropic.com/en/docs/claude-code/sdk#command-line for available options
53+
claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"'
54+

0 commit comments

Comments
 (0)