Skip to content

Commit e1a79b9

Browse files
authored
Add commit hash to location. (#41)
Part of PLAT-1576
1 parent 4781cd4 commit e1a79b9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/ai/nightfall/scan/model/Location.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ public class Location {
1313
@JsonProperty("codepointRange")
1414
private Range codepointRange;
1515

16+
@JsonProperty("commitHash")
17+
private String commitHash;
18+
1619
/**
1720
* Get the finding's byte range.
1821
*
@@ -32,11 +35,21 @@ public Range getCodepointRange() {
3235
return codepointRange;
3336
}
3437

38+
/**
39+
* Get the finding's commit hash.
40+
*
41+
* @return the hash of the commit in which a finding was detected if known.
42+
*/
43+
public String getCommitHash() {
44+
return commitHash;
45+
}
46+
3547
@Override
3648
public String toString() {
3749
return "Location{"
3850
+ "byteRange=" + byteRange
3951
+ ", codepointRange=" + codepointRange
52+
+ ", commitHash=" + commitHash
4053
+ '}';
4154
}
4255

0 commit comments

Comments
 (0)