mirror of
https://github.com/unclebob/crapper.git
synced 2026-11-26 18:18:49 +00:00
Name a Swift module after the workspace when both bundles exist.
Coverage already runs the .xcworkspace instead of the .xcodeproj beside it, but the module name came from the project. A file next to Proj.xcodeproj and Work.xcworkspace was Demo'd as Proj.ContentView. The namer now checks the workspace first, and that test expects Work.ContentView. A directory with only a project is unchanged. Co-authored-by: Robert C. Martin <[email protected]>
This commit is contained in:
co-authored by
Robert C. Martin
parent
c69b49dea5
commit
95c17c42ab
@@ -74,7 +74,7 @@ Swift counts `if` (each `else if` is another `if`), `guard`, `for`, `while`, `re
|
||||
|
||||
Entries are top-level functions, methods on classes, structs, enums, actors, extensions, and protocols, initializers, deinitializers, subscripts, computed properties, and property observers. A requirement or accessor with no statements, such as `{ get set }`, is not an entry. `get`, `set`, `willSet`, and `didSet` stay inside the property. A closure stored directly in a `let` or `var` is an entry. Any other closure stays inside the enclosing function, the same way a nested callback stays inside its function in TypeScript. A type declared inside a function keeps its own methods, and those methods are not also charged to the outer function.
|
||||
|
||||
The namespace is the module, or `Module.Type` for a member (`Module.Outer.Inner` for a nested type, `Module.Array` for an extension). The module is the SwiftPM target whose path contains the file, otherwise the directory under `Sources/`, otherwise the nearest `.xcodeproj` or `.xcworkspace` name, otherwise the dotted directory path with `src/` removed. uml-viewer groups on that namespace and joins `:name`. mutator uses the same function list, including each entry's byte span, so a nested closure's mutations belong to the enclosing function.
|
||||
The namespace is the module, or `Module.Type` for a member (`Module.Outer.Inner` for a nested type, `Module.Array` for an extension). The module is the SwiftPM target whose path contains the file, otherwise the directory under `Sources/`, otherwise the nearest `.xcworkspace`, or an `.xcodeproj` when that directory has no workspace, otherwise the dotted directory path with `src/` removed. uml-viewer groups on that namespace and joins `:name`. mutator uses the same function list, including each entry's byte span, so a nested closure's mutations belong to the enclosing function.
|
||||
|
||||
## Coverage commands
|
||||
|
||||
|
||||
Reference in New Issue
Block a user