Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions .github/workflows/VerifyChanges.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ on:
branches: ["main"]

env:
XCODE_VERSION: 26.3
XCODE_VERSION: 27.2

jobs:
lint:
name: Lint
runs-on: macos-26
runs-on: xcode-27
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Select Xcode ${{ env.XCODE_VERSION }}
run: sudo xcode-select -s /Applications/Xcode_"$XCODE_VERSION".app
- name: Lint
run: Scripts/lint
run: Tools/lint

build-and-test:
name: Build and Test (${{ matrix.platform }})
needs: lint
runs-on: macos-26
runs-on: xcode-27
strategy:
fail-fast: false
matrix:
include:
- platform: iOS
xcode_destination: "platform=iOS Simulator,name=iPhone 17 Pro"
xcode_destination: "platform=iOS Simulator,OS=27.2,name=iPhone 18 Pro"
- platform: macOS
xcode_destination: "platform=macOS,arch=arm64"
- platform: tvOS
xcode_destination: "platform=tvOS Simulator,name=Apple TV 4K (3rd generation)"
xcode_destination: "platform=tvOS Simulator,OS=27.2,name=Apple TV 4K (4th generation)"
- platform: watchOS
xcode_destination: "platform=watchOS Simulator,name=Apple Watch Series 11 (46mm)"
xcode_destination: "platform=watchOS Simulator,OS=27.2,name=Apple Watch Series 12 (46mm)"

env:
DEV_BUILDS: DevBuilds/Sources
Expand Down Expand Up @@ -96,8 +96,12 @@ jobs:
path: ${{ env.XCODE_TEST_PRODUCTS_PATH }}
key: ${{ steps.cache-xctestproducts-restore.outputs.cache-primary-key }}

# Optional until Xcode records coverage for Swift packages again. With Xcode 27.2, result
# bundles have no coverage for package targets, so xccov can’t report it.
- name: Log Code Coverage
id: coverage
if: github.event_name != 'push'
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
Expand All @@ -123,7 +127,7 @@ jobs:
include-hidden-files: true

- name: Upload xccovPretty output
if: github.event_name != 'push'
if: github.event_name != 'push' && steps.coverage.outcome == 'success'
uses: actions/upload-artifact@v7
with:
name: xccovPrettyOutput-${{ matrix.platform }}
Expand All @@ -140,11 +144,14 @@ jobs:

steps:
- name: Download xccovPretty output
id: download-coverage
continue-on-error: true
uses: actions/download-artifact@v8
with:
name: xccovPrettyOutput-macOS

- name: Post Code Coverage Comment
if: steps.download-coverage.outcome == 'success'
uses: thollander/actions-comment-pull-request@v3
with:
file-path: xccovPretty-macOS.output
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc

.rumdl_cache/
30 changes: 30 additions & 0 deletions .rumdl.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# MD005 is off with it, since it flattens indented lists. MD029 is off because list numbers are
# content: rumdl splits lists whose markers are right-aligned (" 9.", "10.") and its fix renumbers
# the second half from 1. MD076 is off because the style guide puts nested lists and code blocks
# inside list items without blank lines between items.
[global]
disable = ["MD005", "MD029", "MD032", "MD033", "MD036", "MD025", "MD041", "MD046", "MD057", "MD060", "MD076"]
respect_gitignore = true

[MD004]
style = "dash"

[MD007]
indent = 4
start-indented = true
start-indent = 2
style = "fixed"

[MD012]
maximum = 2

[MD013]
line-length = 100
code-blocks = false
tables = false
headings = false
reflow = true

[MD022]
lines-above = [0, 2, 1, 1, 1, 1]
lines-below = 1
68 changes: 68 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Agent Guidelines

DevTesting is a Swift package of testing utilities in two libraries. DevRandom has a
seedable random number generator and random value extensions that work outside tests.
DevTesting adds `RandomValueGenerating` for repeatable random test data, and `Stub` and
`ThrowingStub` for mocks. Other DevKit packages use it for their tests.


## Building and testing

- `swift build` and `swift test` build and test the package.
- Xcode test plans in `Build Support/Test Plans/` run the tests with coverage, as CI does.


## Writing style

- Follow the [Markdown Style Guide](Documentation/MarkdownStyleGuide.md) for all Markdown.
- **Use typographic quotes and apostrophes, not straight ones,** in all Markdown, all code
documentation (doc comments and standalone comments), and all user-facing strings:
- Apostrophes: ’ (U+2019), as in “it’s”
- Single quotes: ‘ (U+2018) and ’ (U+2019)
- Double quotes: “ (U+201C) and ” (U+201D)

Straight quotes (`'` and `"`) are still correct in code itself: string literal delimiters,
code spans, code blocks, identifiers, and configuration files.


## Attribution

Never credit an agent or other code generation tool. Don’t add `Co-Authored-By` trailers or
“Generated with” lines to commits or pull requests, and don’t name an agent in file headers,
comments, or documentation. File headers name the git user. The programmer who uses a tool is
accountable for the changes it helped make.


## Commits and pull requests

A commit message is a short summary of what the commit does, then a blank line and a bulleted list
of the changes, close to what a changelog would say. Messages are plain text with lines of 72
characters or fewer. A pull request uses its commit message: the title is the summary, and the
body is the bullets.

Add an entry to `CHANGELOG.md` for changes that affect the library’s users.


## Code

Follow these guides before writing or reviewing Swift:

- [Swift Style Guide](Documentation/SwiftStyleGuide.md)
- [Testing Guidelines](Documentation/Testing/TestingGuidelines.md)

Also:

- Document and test every public API, and keep test coverage above 99%.
- Other DevKit packages depend on DevTesting, so public API changes affect them. Update
the DocC documentation in `Sources/*/Documentation.docc/` along with the API.


## Formatting and linting

- `Tools/format` formats Swift with swift-format and Markdown with rumdl, in place.
- `Tools/lint` checks both, plus comment line length, which swift-format doesn’t check.
- Configuration is in `.swift-format` (120-character lines) and `.rumdl.toml` (100-character
lines for Markdown).
- `Tools/install-git-hooks` installs a pre-push hook that runs `Tools/lint`.

Run `Tools/lint` before considering a change done.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# DevTesting Changelog


## 1.8.0: November 24, 2026

This release requires Swift 6.4 (Xcode 27) to build. There are no other changes.


## 1.7.0: November 13, 2026

This release makes it possible to create stubs that return a placeholder value until they’re
Expand Down
109 changes: 0 additions & 109 deletions CLAUDE.md

This file was deleted.

30 changes: 20 additions & 10 deletions Documentation/MarkdownStyleGuide.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Markdown Style Guide

This document defines the Markdown formatting standards for documentation in this codebase.
This document defines the Markdown formatting standards for documentation in this project.


## General Formatting
Expand All @@ -22,10 +22,10 @@ to stay within this limit.

Use consistent spacing for visual hierarchy:

- **Between major sections**: 2 blank lines
- **After code blocks**: 1 blank line
- **Before subsections**: 1 blank line
- **After section headers**: 1 blank line
- **Between major sections**: 2 blank lines
- **After code blocks**: 1 blank line
- **Before subsections**: 1 blank line
- **After section headers**: 1 blank line

Example:

Expand Down Expand Up @@ -77,15 +77,15 @@ Use **4-space indentation** for all code blocks instead of fenced blocks:
import DevTesting

final class MockService: ServiceProtocol {
nonisolated(unsafe) var performActionStub: Stub<String, Bool>!
nonisolated(unsafe) var performActionStub = Stub<String, Bool>()
}

❌ Bad:
```swift
import DevTesting

final class MockService: ServiceProtocol {
nonisolated(unsafe) var performActionStub: Stub<String, Bool>!
nonisolated(unsafe) var performActionStub = Stub<String, Bool>()
}
```

Expand Down Expand Up @@ -154,9 +154,19 @@ Use backticks for:

Use consistent terminology throughout documents:

- Prefer "function" over "method" when referring to Swift functions
- Use "type" instead of "class" when referring generically to classes/structs/enums
- Use "property" for stored and computed properties
- Prefer “function” over “method” when referring to Swift functions
- Use “type” instead of “class” when referring generically to classes/structs/enums
- Use “property” for stored and computed properties


## Typography

Use typographic quotes and apostrophes, not straight ones, in prose: ’ for apostrophes (“it’s”),
‘ and ’ for single quotes, and “ and ” for double quotes. Straight quotes remain correct inside code
spans and code blocks.

The same rule applies to code documentation (doc comments and standalone comments) and to
user-facing strings.


## File Structure Examples
Expand Down
7 changes: 7 additions & 0 deletions Documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# DevTesting Documentation

Guides for writing code and docs in DevTesting:

- [Swift Style Guide](SwiftStyleGuide.md)
- [Testing Guidelines](Testing/TestingGuidelines.md)
- [Markdown Style Guide](MarkdownStyleGuide.md)
Loading
Loading