Commit e6a78f5
authored
Replace hardcoded config fallback version with dynamic constant (#381)
* Replace hardcoded config fallback version with dynamic constant
Previously, when loading the config file, the fallback version `”0.3.0"` was hardcoded
to handle unversioned configs from earlier releases.
This commit replaces the hardcoded value with the centralized `version` constant,
ensuring consistency across the codebase and reducing the risk of version mismatches
in the future.
* Make `version` field in config mandatory and remove fallback logic
This commit aligns with the decision to drop support for configurations without a version field (pre-0.3.0). The `version` property in `Config` is now non-optional and must be explicitly set at creation.
- Removed the fallback assignment to "0.3.0"
- Updated all code to require and use non-optional `version`
- Adjusted the config initializer to take `version` as a parameter
- Simplified conditional checks and eliminated `.version?`
This ensures that swiftly no longer silently accepts or upgrades legacy configurations without an explicit version.
* Fix test build by adding required `version` to Config initializers
* Apply Swift formatting using `swiftformat` on Sources and Tests1 parent ab2dc50 commit e6a78f5
File tree
3 files changed
+10
-13
lines changed- Sources/Swiftly
- Tests/SwiftlyTests
3 files changed
+10
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
| 32 | + | |
| 33 | + | |
37 | 34 | | |
38 | 35 | | |
39 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
181 | | - | |
182 | | - | |
183 | | - | |
| 181 | + | |
| 182 | + | |
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
| 224 | + | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
| |||
0 commit comments