Skip to content

Commit a891eb0

Browse files
committed
wip
1 parent 2efc79a commit a891eb0

File tree

8 files changed

+160
-19
lines changed

8 files changed

+160
-19
lines changed

.github/FUNDING.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# These are supported funding model platforms
2+
3+
github: [coenttb]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
12+
polar: # Replace with a single Polar username
13+
buy_me_a_coffee: # Replace with a single Buy Me a Coffee username
14+
thanks_dev: # Replace with a single thanks.dev username
15+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.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: "monthly"
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "monthly"

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ jobs:
3131
uses: actions/cache@v4
3232
with:
3333
path: .build
34-
key: ${{ runner.os }}-swift62-spm-${{ github.sha }}
34+
key: macos-swift62-spm-${{ hashFiles('Package.swift', 'Package@*.swift') }}
3535
restore-keys: |
36-
${{ runner.os }}-swift62-spm-
36+
macos-swift62-spm-
3737
3838
# Note: swift test builds automatically, no separate build step needed
3939
- name: Test
@@ -69,8 +69,8 @@ jobs:
6969
uses: actions/cache@v4
7070
with:
7171
path: .build
72-
key: ${{ runner.os }}-swift62-spm-${{ github.sha }}
73-
restore-keys: ${{ runner.os }}-swift62-spm-
72+
key: linux-swift62-spm-${{ hashFiles('Package.swift', 'Package@*.swift') }}
73+
restore-keys: linux-swift62-spm-
7474

7575
# Note: swift test builds automatically in release mode
7676
- name: Test (release)
@@ -89,8 +89,8 @@ jobs:
8989
uses: actions/cache@v4
9090
with:
9191
path: .build
92-
key: ${{ runner.os }}-swift62-compat-spm-${{ github.sha }}
93-
restore-keys: ${{ runner.os }}-swift62-compat-spm-
92+
key: linux-swift62-compat-spm-${{ hashFiles('Package.swift', 'Package@*.swift') }}
93+
restore-keys: linux-swift62-compat-spm-
9494

9595
# Note: swift test builds automatically
9696
- name: Test (Swift 6.2)

.github/workflows/swift-format.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Swift Format
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
swift_format:
10+
name: swift-format
11+
runs-on: ubuntu-latest
12+
container: swift:6.2
13+
permissions:
14+
contents: write
15+
steps:
16+
- uses: actions/checkout@v5
17+
18+
- name: Cache swift-format
19+
id: cache-swift-format
20+
uses: actions/cache@v4
21+
with:
22+
path: /usr/local/bin/swift-format
23+
key: ${{ runner.os }}-swift-format-${{ hashFiles('.github/workflows/swift-format.yml') }}
24+
25+
- name: Install swift-format
26+
if: steps.cache-swift-format.outputs.cache-hit != 'true'
27+
run: |
28+
git clone --depth 1 --branch $(git ls-remote --tags https://github.com/apple/swift-format.git | grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' | sort -V | tail -1 | sed 's/refs\/tags\///') https://github.com/apple/swift-format.git
29+
cd swift-format
30+
swift build -c release
31+
cp .build/release/swift-format /usr/local/bin/
32+
cd ..
33+
rm -rf swift-format
34+
35+
- name: Format
36+
run: swift-format format --recursive --in-place --ignore-unparsable-files Sources Tests
37+
38+
- uses: stefanzweifel/git-auto-commit-action@v7
39+
with:
40+
commit_message: Run swift-format
41+
branch: 'main'

.github/workflows/swiftlint.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: SwiftLint
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
lint:
13+
name: SwiftLint
14+
runs-on: ubuntu-latest
15+
container: swift:6.2
16+
steps:
17+
- uses: actions/checkout@v5
18+
19+
- name: Restore swiftlint cache
20+
id: cache-swiftlint-restore
21+
uses: actions/cache/restore@v4
22+
with:
23+
path: /usr/local/bin/swiftlint
24+
key: ${{ runner.os }}-swiftlint-0.62.2
25+
26+
- name: Install swiftlint
27+
if: steps.cache-swiftlint-restore.outputs.cache-hit != 'true'
28+
run: |
29+
git clone --depth 1 --branch 0.62.2 https://github.com/realm/SwiftLint.git
30+
cd SwiftLint
31+
swift build -c release
32+
cp .build/release/swiftlint /usr/local/bin/
33+
cd ..
34+
rm -rf SwiftLint
35+
36+
- name: Lint
37+
run: swiftlint lint --strict --reporter github-actions-logging
38+
39+
- name: Save swiftlint cache
40+
uses: actions/cache/save@v4
41+
if: always() && steps.cache-swiftlint-restore.outputs.cache-hit != 'true'
42+
with:
43+
path: /usr/local/bin/swiftlint
44+
key: ${{ runner.os }}-swiftlint-0.62.2

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,3 @@ Thumbs.db
2323
!CODE_OF_CONDUCT.md
2424
!SECURITY.md
2525
!**/*.docc/**/*.md
26-
27-
28-
# SwiftLint Remote Config Cache
29-
.swiftlint/RemoteConfigCache

.swift-format

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"version": 1,
3-
"lineLength": 120,
3+
"lineLength": 100,
44
"indentation": {
55
"spaces": 4
66
},
77
"tabWidth": 8,
88
"maximumBlankLines": 1,
99
"respectsExistingLineBreaks": true,
1010
"lineBreakBeforeControlFlowKeywords": false,
11-
"lineBreakBeforeEachArgument": false,
11+
"lineBreakBeforeEachArgument": true,
1212
"lineBreakBeforeEachGenericRequirement": false,
1313
"prioritizeKeepingFunctionOutputTogether": true,
1414
"indentConditionalCompilationBlocks": true,
@@ -18,8 +18,8 @@
1818
},
1919
"rules": {
2020
"AllPublicDeclarationsHaveDocumentation": false,
21-
"AlwaysUseLowerCamelCase": true,
22-
"AmbiguousTrailingClosureOverload": false,
21+
"AlwaysUseLowerCamelCase": false,
22+
"AmbiguousTrailingClosureOverload": true,
2323
"BeginDocumentationCommentWithOneLineSummary": false,
2424
"DoNotUseSemicolons": true,
2525
"DontRepeatTypeInStaticProperties": true,

.swiftlint.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,42 @@
1-
# SwiftLint configuration for swift-numeric-formatting-standard
2-
# Inherits from the shared parent configuration in swift-standards
1+
disabled_rules:
2+
- line_length
3+
- trailing_comma
4+
- redundant_discardable_let
5+
- identifier_name # Allow short variable names (i, x, y, etc.)
6+
- large_tuple # Allow tuples with more than 2 members
7+
- optional_data_string_conversion # False positive with String(decoding:as:)
8+
- for_where # False positives when for loops have complex logic, not just filtering
9+
- todo # Allow TODO comments for tracking future work
10+
- type_body_length # Don't enforce maximum type body length
11+
- nesting # Allow nested types for hierarchical APIs
12+
- type_name # Allow flexible test suite naming (lowercase, special chars, etc.)
13+
- cyclomatic_complexity # Allow complex inline logic over helper extraction
14+
- implicit_optional_initialization # Allow explicit = nil initialization
15+
- function_body_length # Allow longer inline functions
16+
- file_length # Allow longer files
317

4-
parent_config: https://raw.githubusercontent.com/swift-standards/swift-standards/main/.swiftlint.yml
18+
opt_in_rules:
19+
- explicit_init
20+
- closure_spacing
21+
- empty_count
22+
- empty_string
23+
- fatal_error_message
24+
- first_where
25+
- joined_default_parameter
26+
- operator_usage_whitespace
27+
- overridden_super_call
528

6-
# Package-specific overrides (if needed)
7-
# Add any swift-numeric-formatting-standard specific rules here
29+
included:
30+
- Sources
31+
- Tests
32+
33+
excluded:
34+
- .build
35+
- Carthage
36+
- Pods
37+
- fastlane
38+
39+
# Function parameter count (kept as a reasonable limit)
40+
function_parameter_count:
41+
warning: 6
42+
error: 8

0 commit comments

Comments
 (0)