Skip to content

Commit

Permalink
Comment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
traut committed Nov 29, 2024
1 parent 379e2f8 commit a9566d1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/builtin/data_csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func makeCSVDataSource() *plugin.DataSource {
},
},
Doc: `
Loads CSV files with the names that match a provided ` + "`glob`" + ` pattern or a single file from a provided path.
Loads CSV files with the names that match provided ` + "`glob`" + ` pattern or a single file from a provided path.
Either ` + "`glob` or `path` argument must be set." + `
Expand Down
6 changes: 3 additions & 3 deletions internal/builtin/data_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func makeJSONDataSource() *plugin.DataSource {
},
},
Doc: `
Loads JSON files with the names that match a provided ` + "`glob`" + ` pattern or a single file from a provided ` + "`path`" + `value.
Loads JSON files with the names that match provided ` + "`glob`" + ` pattern or a single file from provided ` + "`path`" + `value.
Either ` + "`glob`" + ` or ` + "`path`" + ` argument must be set.
Expand Down Expand Up @@ -80,13 +80,13 @@ func fetchJSONData(ctx context.Context, params *plugin.RetrieveDataParams) (plug
)
return nil, diagnostics.Diag{{
Severity: hcl.DiagError,
Summary: "Failed to read a file",
Summary: "Failed to read the file",
Detail: err.Error(),
}}
}
return data, nil
} else if !glob.IsNull() && glob.AsString() != "" {
slog.Debug("Reading the files that match a glob pattern", "glob", glob.AsString())
slog.Debug("Reading the files that match the glob pattern", "glob", glob.AsString())
data, err := readJSONFiles(ctx, glob.AsString())
if err != nil {
slog.Error(
Expand Down
4 changes: 2 additions & 2 deletions internal/builtin/data_json_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func Test_fetchJSONData(t *testing.T) {
path: filepath.Join("testdata", "json", "invalid.txt"),
expectedDiags: diagtest.Asserts{{
diagtest.IsError,
diagtest.SummaryEquals("Failed to read a file"),
diagtest.SummaryEquals("Failed to read the file"),
diagtest.DetailEquals("invalid character 'i' looking for beginning of object key string"),
}},
},
Expand All @@ -69,7 +69,7 @@ func Test_fetchJSONData(t *testing.T) {
path: filepath.Join("testdata", "json", "unknown_dir", "does-not-exist.json"),
expectedDiags: diagtest.Asserts{{
diagtest.IsError,
diagtest.SummaryEquals("Failed to read a file"),
diagtest.SummaryEquals("Failed to read the file"),
diagtest.DetailContains("open", "does-not-exist.json"),
}},
},
Expand Down
2 changes: 1 addition & 1 deletion internal/builtin/data_txt.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func makeTXTDataSource() *plugin.DataSource {
},
},
Doc: `
Loads TXT files with the names that match a provided ` + "`glob`" + ` pattern or a single file from a provided path.
Loads TXT files with the names that match provided ` + "`glob`" + ` pattern or a single file from a provided path.
Either ` + "`glob`" + ` or ` + "`path`" + ` argument must be set.
Expand Down

0 comments on commit a9566d1

Please sign in to comment.