Skip to content

Releases

0.5.1

Choose a tag to compare

@mackoj mackoj released this 15 Nov 17:05
05001df

What's Changed

  • Add .spi.yml for Swift Package Index documentation by @mackoj in #14
  • Site: many codebases, not five by @mackoj in #19
  • README: make the symbolic-link example compile by @mackoj in #20
  • Add Scope.unexplainedNonExhaustiveTestStores by @mackoj in #21

Full Changelog: 0.5.0...0.5.1

0.5.0

Choose a tag to compare

@mackoj mackoj released this 14 Nov 04:39
d4877f1

Added

  • Built-in detectors on Scope (#15): xcTestImports, disabledTests, unexplainedKnownIssues, unexplainedExpectedFailures, uncommentedUncheckedSendable (doc comments don't count; sees the comment after {), forcedTries, optionalTries, forcedCasts (finds the unfolded UnresolvedAsExprSyntax too), forceUnwraps.
  • Declaration helpers (#16): isPublic, attribute(_:)/attributes(_:), genericParameters (GenericParameter), contains(_:) (no comments or strings), calls(named:), nodes(of:).
  • SourceFile.module, Scope.topLevelStatements(notUnder:), firstDescendant(of:)/descendants(of:), TypeSyntax.closureType/hasAttribute(_:) (#16).
  • Symbolic links (#17): symbolicLinks: skip | follow in .llm-check.yaml (default follow, as before) and SourceFile.symbolicLinkDestination.
  • README: "Unfolded expressions" explains that SwiftParser leaves as!, is and binary operators unfolded.

Changed

  • Faster: parsing 1.5x, declarations 4x, calls(named:) 6x, references(to:) 4x, imports(of:) 5.5x, containing(_:) 20x (README, "Benchmarks").

Fixed

  • A codebase whose root is a symbolic link lists its files.
  • inherits(from: "Sendable") is true for @unchecked Sendable.

Full list: CHANGELOG.md, 0.5.0.

0.4.1

Choose a tag to compare

@mackoj mackoj released this 13 Nov 22:43
9d07478

What's Changed

  • Adoption notes: swift-arazzo is on 0.4.0 by @mackoj in #8
  • Add Match.erased; adoption notes: swift-jsonpath by @mackoj in #9

Full Changelog: 0.4.0...0.4.1

0.4.0

Choose a tag to compare

@mackoj mackoj released this 13 Nov 21:15
eb65738

What's Changed

  • CHANGELOG: 0.3.0 is released by @mackoj in #5
  • Add import and #if clause queries by @mackoj in #6
  • Add adoption notes from Telaio, forum-offline and swift-arazzo by @mackoj in #7

Full Changelog: 0.3.0...0.4.0

0.3.0

Choose a tag to compare

@mackoj mackoj released this 10 Nov 22:49
ce9fea2

Added

  • isAwaited on any node: whether it sits under an await in its own expression (try await f(),
    (try? await f()) ?? []). The search stops at the enclosing statement, closure or declaration, so a call inside
    Task { } or inside an awaited call's closure is not awaited. For rules such as "database access is awaited".
  • FunctionCallExprSyntax.argument(labeled:) returns the argument with a label, and passesClosure says whether a
    closure is passed, trailing or as an argument.
  • Scope.calls(named:) takes a Set<String>, for a list of names built at run time.
  • Baseline(covering:) builds a baseline that accepts exactly the given findings, one File.swift:Declaration entry
    each, and swiftArrayLiteral renders it for pasting into a test. It lands a rule on code that already breaks it
    without hand-writing the entries.

0.2.0

Choose a tag to compare

@mackoj mackoj released this 05 Nov 23:20
c633466

Breaking

  • import LLMCheck no longer re-exports SwiftSyntax. SwiftSyntax and Testing both declare SourceLocation, so the
    re-export forced every rule file that imports Testing to write Testing.SourceLocation. Scopes, declarations,
    calls(named:), references(to:), calledName, receiver and the members of returned nodes still work with
    import LLMCheck alone. To migrate, a file that names a node type (CodeBlockItemSyntax, InOutExprSyntax.self,
    .is(StringLiteralExprSyntax.self)…) adds import SwiftSyntax, and its test target adds the product:

    .package(url: "https://github.com/swiftlang/swift-syntax.git", "601.0.0"..<"700.0.0"),
    // …
    .product(name: "SwiftSyntax", package: "swift-syntax"),
  • Scope.in(_:) reads patterns like excluding(_:) and excludes. A name without a slash now matches a folder or
    file at any depth, as it already did for exclusions; a path with a slash still matches from the root. in("Sources")
    used to mean the top-level Sources folder only; it now also matches Packages/Kit/Sources. To keep the old
    meaning, anchor the name with a leading slash: in("/Sources"). Paths with a slash (in("Packages/Features")) are
    unchanged.

Added

  • XCTest assertions: inside an XCTestCase, expectNone(_:rule:baseline:) and expectAll(_:rule:baseline:_:) are
    methods that record an XCTest failure at each violation's file and line, and stale baseline entries at the call
    site. record(_:) reports a CheckResult the same way.
  • SourceFile is Hashable, so rules can write declaration.file == other.file or build a Set of files. Equality
    is identity: a codebase parses each path once per process, so its files compare like their paths, while in-memory
    files made separately differ even with the same path.
  • A leading slash anchors a single name at the root (/Sources). It worked in excluding(_:) and excludes by
    accident; it is now documented and tested for all three.

Fixed

  • Files with CRLF (\r\n) or CR line endings: snippets were empty past line 1, because "\r\n" is a single Swift
    Character and lines were split on "\n" only. A CRLF .llm-check.yaml failed to parse for the same reason.
  • .llm-check.yaml: a comment after a tab (- build\t# why) is stripped like one after a space.

Performance

  • Declarations are built on every core. On Telaio (992 files, 220,000 lines) in a debug build, every declaration of
    the whole tree takes 0.18 s instead of 0.78 s.

0.1.0

Choose a tag to compare

@mackoj mackoj released this 05 Nov 22:33
6bb9260

First release: architecture rules as Swift Testing tests, for agents.

  • Codebase and scopes (production, test, all; in, excluding, containing) with one parse per file per process, safe under parallel suites.
  • Declaration queries, deep node search (nodes(of:)), calls, identifier references, attached comments.
  • Rule (id, title, category, rationale, how to fix, bad and good examples), expectNone/expectAll at the exact line, baselines that fail on stale entries, and a Markdown rule catalog.
  • Only dependency: swift-syntax 601 and later.