Skip to content

Commit

Permalink
Fix typo in error message. (#340)
Browse files Browse the repository at this point in the history
Fix a confusing typo from "affected filed" to "affected field".

Signed-off-by: Viviana Sutedjo <[email protected]>
  • Loading branch information
vsutedjo authored Feb 27, 2025
1 parent fa0a097 commit 534fb75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tools/osv-linter/internal/checks/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ var CheckRecordHasAffected = &CheckDef{
func RecordHasAffected(json *gjson.Result, config *Config) (findings []CheckError) {
affectedEntries := json.Get("affected")
if !affectedEntries.Exists() || affectedEntries.String() == "[]" {
findings = append(findings, CheckError{Message: "Invalid Affected: affected filed cannot be null or empty"})
findings = append(findings, CheckError{Message: "Invalid Affected: affected field cannot be null or empty"})
}
return findings
}
4 changes: 2 additions & 2 deletions tools/osv-linter/internal/checks/record_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ func TestAffectedField(t *testing.T) {
args: args{
json: LoadTestData("../../test_data/SUSE-FU-2022:0444-1.json"),
},
wantFindings: []CheckError{{Message: "Invalid Affected: affected filed cannot be null or empty"}},
wantFindings: []CheckError{{Message: "Invalid Affected: affected field cannot be null or empty"}},
},
{
name: "A file without affected field",
args: args{
json: LoadTestData("../../test_data/RHSA-2022:0216.json"),
},
wantFindings: []CheckError{{Message: "Invalid Affected: affected filed cannot be null or empty"}},
wantFindings: []CheckError{{Message: "Invalid Affected: affected field cannot be null or empty"}},
},
}
for _, tt := range tests {
Expand Down

0 comments on commit 534fb75

Please sign in to comment.