diffplug / diffplug/selfie

Ignore comments within String constants

Open
#81 0 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Kotlin
Stars
101
Forks
18
PR merge metrics
No merged PRs in 30d

Description

This code is too simple.

https://github.com/diffplug/selfie/blob/6c3d0ee489152ff87aff5251b05e75314491ad3c/selfie-lib/src/commonMain/kotlin/com/diffplug/selfie/guts/CommentTracker.kt#L51-L54

https://github.com/diffplug/selfie/blob/6c3d0ee489152ff87aff5251b05e75314491ad3c/selfie-lib/src/commonMain/kotlin/com/diffplug/selfie/guts/SourceFile.kt#L83-L87

For example:

```java
class Test {
@Test public void example() {
expectSelfie("underTest").toBe("""
This is a string constant
// selfieonce
The comment above is not really a comment.
We effectively have a "forbidden value" that can't be inside inline snapshots.
""")
}
}
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.