Repository navigation
Releases
0.5.1
0.5.0
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 unfoldedUnresolvedAsExprSyntaxtoo),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 | followin.llm-check.yaml(defaultfollow, as before) andSourceFile.symbolicLinkDestination. - README: "Unfolded expressions" explains that SwiftParser leaves
as!,isand 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
0.4.0
0.3.0
Added
isAwaitedon any node: whether it sits under anawaitin 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, andpassesClosuresays whether a
closure is passed, trailing or as an argument.Scope.calls(named:)takes aSet<String>, for a list of names built at run time.Baseline(covering:)builds a baseline that accepts exactly the given findings, oneFile.swift:Declarationentry
each, andswiftArrayLiteralrenders it for pasting into a test. It lands a rule on code that already breaks it
without hand-writing the entries.
0.2.0
Breaking
-
import LLMCheckno longer re-exports SwiftSyntax. SwiftSyntax and Testing both declareSourceLocation, so the
re-export forced every rule file that imports Testing to writeTesting.SourceLocation. Scopes, declarations,
calls(named:),references(to:),calledName,receiverand the members of returned nodes still work with
import LLMCheckalone. To migrate, a file that names a node type (CodeBlockItemSyntax,InOutExprSyntax.self,
.is(StringLiteralExprSyntax.self)…) addsimport 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 likeexcluding(_:)andexcludes. 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-levelSourcesfolder only; it now also matchesPackages/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:)andexpectAll(_: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 aCheckResultthe same way. SourceFileisHashable, so rules can writedeclaration.file == other.fileor build aSetof 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 inexcluding(_:)andexcludesby
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
Characterand lines were split on"\n"only. A CRLF.llm-check.yamlfailed 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
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/expectAllat the exact line, baselines that fail on stale entries, and a Markdown rule catalog.- Only dependency: swift-syntax 601 and later.