Skip to content

Commit 2f9a0f1

Browse files
Merge remote-tracking branch 'origin/main' into merge-protocol-v6-into-main
2 parents e14f8b0 + a536b1f commit 2f9a0f1

8 files changed

Lines changed: 60 additions & 70 deletions

File tree

.cursor/rules/specification.mdc

Lines changed: 0 additions & 14 deletions
This file was deleted.

.cursor/rules/swift.mdc

Lines changed: 0 additions & 28 deletions
This file was deleted.

.cursor/rules/testing.mdc

Lines changed: 0 additions & 20 deletions
This file was deleted.

AblyLiveObjects.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CLAUDE.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,37 @@ swift run BuildTool lint
2323
```
2424

2525
Use `--fix` to auto-fix where possible.
26+
27+
## Specification Document
28+
29+
The _Specification Document_ (or simply "the specification" or "the spec") specifies much of the behaviour of this codebase. It lives in the `specification` repository. If you need to consult it and you haven't been told where to find a local copy, ask.
30+
31+
- The specification is structured as a list of specification points, each with an identifier such as `OD1`. Some specification points have subpoints, e.g. `REC2a`, which in turn can have subpoints like `REC2a1`. In the specification's Markdown source, the start of specification point `OD1` is represented by `` `(OD1)` ``.
32+
- The LiveObjects functionality is referred to in the specification simply as "Objects". The LiveObjects-specific spec points are in a separate file, `specifications/objects-features.md`.
33+
- If you are given a task that requires knowledge of the specification, you must consult it before proceeding. Never guess its contents.
34+
- If the specification is unclear, mention this.
35+
36+
## Swift style
37+
38+
- Satisfy SwiftLint's `explicit_acl` rule (all declarations must specify access control level keywords explicitly).
39+
- When writing an `extension` of a type, prefer placing the access level on the extension declaration rather than on each individual member.
40+
- This does not apply to test code.
41+
- When the type being initialised can be inferred, use the implicit `.init(…)` form instead of writing the type name explicitly.
42+
- When the enum type can be inferred, use the implicit `.caseName` form instead of writing the type name explicitly.
43+
- When writing `JSONValue` or `WireValue` types, use the literal syntax enabled by their `ExpressibleBy*Literal` conformances where possible.
44+
- When writing a JSON string, use Swift raw string literals instead of escaping double quotes.
45+
- When importing these modules in library (non-test) code:
46+
- Ably: `import Ably`
47+
- `_AblyPluginSupportPrivate`: `internal import _AblyPluginSupportPrivate`
48+
- When writing an array literal that starts with an initialiser expression, start the initialiser on the line after the opening square bracket:
49+
50+
```swift
51+
// Do this:
52+
objectMessages: [
53+
InboundObjectMessage(
54+
id: nil,
55+
56+
// Not this:
57+
objectMessages: [InboundObjectMessage(
58+
id: nil,
59+
```

Package.resolved

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ let package = Package(
2121
// TODO: Unpin before release
2222
.package(
2323
url: "https://github.com/ably/ably-cocoa.git",
24-
revision: "460c1d11333dd58bbc924a3d153d1364b39bbdf0",
24+
revision: "68e9b6fc786f0c2c425d095b3cf3366844fd0507",
2525
),
2626
// TODO: Unpin before release
2727
.package(
2828
url: "https://github.com/ably/ably-cocoa-plugin-support",
29-
revision: "f2468ee39f3e18955b0ec4fe41dc5a9906a72633",
29+
revision: "36c529db38154d01537e782f7ed4aa7535fb3237",
3030
),
3131
.package(
3232
url: "https://github.com/apple/swift-argument-parser",
@@ -72,6 +72,9 @@ let package = Package(
7272
package: "ably-cocoa-plugin-support",
7373
),
7474
],
75+
exclude: [
76+
"CLAUDE.md",
77+
],
7578
resources: [
7679
.copy("ably-common"),
7780
],
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Testing guidelines
2+
3+
- Use the Swift Testing framework (`import Testing`), not XCTest.
4+
- Do not use `fatalError` in response to a test expectation failure; use Swift Testing's `#require` macro instead.
5+
- Only add labels to test cases or suites when the label differs from the name of the suite `struct` or test method.
6+
- Follow the guidelines under "Attributing tests to a spec point" in `CONTRIBUTING.md` to tag unit tests with the relevant specification points. Follow the exact comment format described there. Pay particular attention to the difference between `@spec` and `@specPartial`, and do not write `@spec` multiple times for the same specification point.
7+
- Add comments explaining when some piece of test data is not important for the scenario being tested.
8+
- Run the tests to check they pass.
9+
- When importing these modules in test code:
10+
- Ably: `import Ably`
11+
- AblyLiveObjects: `@testable import AblyLiveObjects`
12+
- `_AblyPluginSupportPrivate`: `import _AblyPluginSupportPrivate` (not `internal import`)
13+
- When you need to pass a logger to internal components in tests, pass `TestLogger()`.
14+
- When you need to unwrap an optional value in tests, use `#require` instead of `guard let`.
15+
- When creating `testsOnly_` property declarations, do not write generic comments describing them; their meaning is already well understood.

0 commit comments

Comments
 (0)