Skip to content

Commit a65d672

Browse files
authored
Refactor file organization for improved maintainability (#38)
1 parent 4903492 commit a65d672

Some content is hidden

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

46 files changed

+783
-519
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Swift",
3-
"image": "swiftlang/swift:nightly-6.1-jammy",
3+
"image": "swift:6.2",
44
"features": {
55
"ghcr.io/devcontainers/features/common-utils:2": {
66
"installZsh": "false",

.devcontainer/swift-6.0/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "Swift",
2+
"name": "Swift 6.0",
33
"image": "swift:6.0",
44
"features": {
55
"ghcr.io/devcontainers/features/common-utils:2": {

.devcontainer/swift-6.1/devcontainer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "Swift",
3-
"image": "swiftlang/swift:nightly-6.1-jammy",
2+
"name": "Swift 6.1",
3+
"image": "swift:6.1",
44
"features": {
55
"ghcr.io/devcontainers/features/common-utils:2": {
66
"installZsh": "false",
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Swift 6.2",
3+
"image": "swiftlang/swift:6.2",
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+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"name": "Swift 6.3",
3+
"image": "swiftlang/swift:nightly-6.3-jammy",
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/RadiantKit.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ jobs:
213213
restore-keys: |
214214
${{ runner.os }}-mint-
215215
- name: Install mint
216-
if: steps.cache-mint.outputs.cache-hit != 'true'
216+
if: steps.cache-mint.outputs.cache-hit == ''
217217
run: |
218218
git clone https://github.com/yonaskolb/Mint.git
219219
cd Mint

.swift-format

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
"spaces" : 2
77
},
88
"indentConditionalCompilationBlocks" : true,
9-
"indentSwitchCaseLabels" : true,
10-
"lineBreakAroundMultilineExpressionChainComponents" : true,
11-
"lineBreakBeforeControlFlowKeywords" : true,
12-
"lineBreakBeforeEachArgument" : true,
13-
"lineBreakBeforeEachGenericRequirement" : true,
9+
"indentSwitchCaseLabels" : false,
10+
"lineBreakAroundMultilineExpressionChainComponents" : false,
11+
"lineBreakBeforeControlFlowKeywords" : false,
12+
"lineBreakBeforeEachArgument" : false,
13+
"lineBreakBeforeEachGenericRequirement" : false,
1414
"lineLength" : 100,
1515
"maximumBlankLines" : 1,
1616
"multiElementCollectionTrailingCommas" : true,
@@ -26,7 +26,7 @@
2626
"AlwaysUseLiteralForEmptyCollectionInit" : false,
2727
"AlwaysUseLowerCamelCase" : true,
2828
"AmbiguousTrailingClosureOverload" : true,
29-
"BeginDocumentationCommentWithOneLineSummary" : true,
29+
"BeginDocumentationCommentWithOneLineSummary" : false,
3030
"DoNotUseSemicolons" : true,
3131
"DontRepeatTypeInStaticProperties" : true,
3232
"FileScopedDeclarationPrivacy" : false,
@@ -42,7 +42,7 @@
4242
"NoCasesWithOnlyFallthrough" : true,
4343
"NoEmptyTrailingClosureParentheses" : true,
4444
"NoLabelsInCasePatterns" : true,
45-
"NoLeadingUnderscores" : false,
45+
"NoLeadingUnderscores" : true,
4646
"NoParensAroundConditions" : true,
4747
"NoPlaygroundLiterals" : true,
4848
"NoVoidReturnOnFunctionSignature" : true,
@@ -67,4 +67,4 @@
6767
"spacesAroundRangeFormationOperators" : false,
6868
"tabWidth" : 2,
6969
"version" : 1
70-
}
70+
}

.swiftlint.yml

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
opt_in_rules:
22
- array_init
3-
- attributes
43
- closure_body_length
54
- closure_end_indentation
65
- closure_spacing
@@ -22,14 +21,15 @@ opt_in_rules:
2221
- explicit_acl
2322
- explicit_init
2423
- explicit_top_level_acl
25-
- fallthrough
24+
# - fallthrough
2625
- fatal_error_message
2726
- file_name
2827
- file_name_no_space
2928
- file_types_order
29+
- first_where
3030
- flatmap_over_map_reduce
3131
- force_unwrapping
32-
- function_default_parameter_at_end
32+
# - function_default_parameter_at_end
3333
- ibinspectable_in_extension
3434
- identical_operands
3535
- implicit_return
@@ -41,8 +41,9 @@ opt_in_rules:
4141
- legacy_random
4242
- literal_expression_end_indentation
4343
- lower_acl_than_parent
44-
#- missing_docs
44+
- missing_docs
4545
- modifier_order
46+
- multiline_arguments
4647
- multiline_arguments_brackets
4748
- multiline_function_chains
4849
- multiline_literal_brackets
@@ -56,7 +57,6 @@ opt_in_rules:
5657
- optional_enum_case_matching
5758
- overridden_super_call
5859
- override_in_extension
59-
- pattern_matching_keywords
6060
- prefer_self_type_over_type_of_self
6161
- prefer_zero_over_explicit_init
6262
- private_action
@@ -74,48 +74,65 @@ opt_in_rules:
7474
- sorted_first_last
7575
- sorted_imports
7676
- static_operator
77-
- strict_fileprivate
7877
- strong_iboutlet
7978
- toggle_bool
79+
# - trailing_closure
8080
- type_contents_order
8181
- unavailable_function
8282
- unneeded_parentheses_in_closure_argument
8383
- unowned_variable_capture
84+
- untyped_error_in_catch
8485
- vertical_parameter_alignment_on_call
85-
- vertical_whitespace_between_cases
8686
- vertical_whitespace_closing_braces
8787
- vertical_whitespace_opening_braces
8888
- xct_specific_matcher
8989
- yoda_condition
90-
disabled_rules:
91-
- trailing_comma
92-
- strict_fileprivate
93-
- function_default_parameter_at_end
94-
- switch_case_alignment
90+
analyzer_rules:
91+
- unused_import
92+
- unused_declaration
9593
cyclomatic_complexity:
9694
- 6
97-
- 8
98-
type_body_length:
99-
- 125
100-
- 200
95+
- 12
10196
file_length:
102-
- 250
103-
- 300
97+
warning: 225
98+
error: 300
10499
function_body_length:
105-
- 25
106-
- 35
100+
- 50
101+
- 76
107102
function_parameter_count: 8
108103
line_length:
109-
- 90
110-
- 90
104+
- 100
105+
- 200
106+
closure_body_length:
107+
- 50
108+
- 60
111109
identifier_name:
112110
excluded:
113111
- id
114-
- completeFileProtectionUntilFirstUserAuthentication
112+
- no
115113
excluded:
116114
- DerivedData
117115
- .build
118-
- .swiftpm
119116
- Mint
117+
- Examples
120118
indentation_width:
121119
indentation_width: 2
120+
file_name:
121+
severity: error
122+
fatal_error_message:
123+
severity: error
124+
disabled_rules:
125+
- nesting
126+
- implicit_getter
127+
- switch_case_alignment
128+
- closure_parameter_position
129+
- trailing_comma
130+
- opening_brace
131+
- optional_data_string_conversion
132+
- pattern_matching_keywords
133+
custom_rules:
134+
no_unchecked_sendable:
135+
name: "No Unchecked Sendable"
136+
regex: '@unchecked\s+Sendable'
137+
message: "Use proper Sendable conformance instead of @unchecked Sendable to maintain strict concurrency safety"
138+
severity: error

Mintfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
swiftlang/swift-format@600.0.0
2-
realm/SwiftLint@0.58.0
3-
peripheryapp/periphery@2.20.0
1+
swiftlang/swift-format@602.0.0
2+
realm/SwiftLint@0.62.2
3+
peripheryapp/periphery@3.2.0

Sources/RadiantDocs/CodablePackageDocument.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@
8383
configuration.existingFile ?? FileWrapper(directoryWithFileWrappers: [:])
8484

8585
if let oldConfigJSONWrapper = rootFileWrapper
86-
.fileWrappers?[T.configurationFileWrapperKey] {
86+
.fileWrappers?[T.configurationFileWrapperKey]
87+
{
8788
rootFileWrapper.removeFileWrapper(oldConfigJSONWrapper)
8889
}
8990

0 commit comments

Comments
 (0)