Repository navigation
The first stable release. Code that compiles against 1.0.0 keeps compiling with every 1.x version: the README's What 1.x promises says what each 1.x version keeps and what a minor version may change, and CI now fails any change that would break the public API of the Understudy library. The tests were analysed before the release and the code the macros write is now also checked in Swift 5 language mode. Nothing a test writes needs to change.
Added
- README: What 1.x promises, what every 1.x version keeps: the public API, the toolchains, swift-syntax and the platforms; and what a minor version may change in the code the macros write.
ThrowingSpy()for a requirement that returns nothing, asSpy()already has, so a test needn't writeThrowingSpy(returning: ()).scripts/mutate.py, for contributors: mutation testing. It changes one thing at a time inSources/, such as a comparison, a condition or a statement, runs the tests, and lists each change no test noticed. A Mutation testing workflow runs it on the files a pull request changes and lists what survived in the job summary, without failing.- The code the macros write is now tested in a Swift 5 language mode project as well: CI builds and runs the package's tests in Swift 5 mode (
Swift5Mode/), with warnings as errors. - CI now compares the public API of the Understudy library with the latest released version, and fails a change that would break code using it (the Public API kept job). A break meant for a new major version is listed in
.github/api-breakage-allowlist.txt. - For maintainers: a Security alerts workflow posts new code scanning and secret scanning alerts to the project's Slack every 2 hours, with only the kind of secret and a link, never the secret (
scripts/post-security-alerts.sh).
Changed
- A standard type written with its module, such as
Swift.IntorSwift.Set<String>, now gets its obvious value in the double's initializer, asIntandSet<String>do, so a test needn't pass it. A static requirement of such a type is no longer refused. Breaking, in the generated code only:@GenerateSpiesnow writes different code for these types. No test needs to change, because an argument only gains a default, so every call that compiled still compiles. - SonarQube Cloud's quality gate runs first on every pull request and push to main, and checks code quality as well as bugs and security. Until it passes, no other check runs and nothing is released (the Checks workflow).
- SonarQube Cloud judges the tests in
Tests/andBenchmarks/Tests/as tests, so they no longer count as source code. - For contributors: CodeRabbit reviews every file type in the package with rules of its own, not only Swift: the Python and shell scripts, the workflows and other YAML settings,
sonar-project.properties, the generated-code budget and the Markdown docs. It posts what Ruff and ShellCheck find inline, and reports security problems in workflows even when CI's workflow lint would also find them.