Skip to content

Commit 9532544

Browse files
committed
Describe kind/location overrides in the README
1 parent 77350f9 commit 9532544

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,17 @@ Comment commands also support trailing comments following a hyphen so that you c
350350
class MyClass {}
351351
```
352352

353+
### Overriding Result Kind and Location
354+
355+
In generated code scenarios where the generated code is too low-level or obtuse to be directly reported as unused, you can override the `kind` and/or `location` of a result to provide a more meaningful report:
356+
357+
```swift
358+
// periphery:override kind="MyCustomThing" location="path/to/file.swift:42:1"
359+
func generatedFunction() {}
360+
```
361+
362+
The `kind` override allows you to specify a custom kind that will be shown in the result. The `location` override uses the format `file:line:column` (line and column default to 1 if omitted). This is particularly useful when you want to report results at a higher-level definition rather than at the low-level generated code.
363+
353364
## Xcode Integration
354365

355366
Before setting up Xcode integration, we highly recommend you first get Periphery working in a terminal, as you will be using the same command via Xcode.

0 commit comments

Comments
 (0)