-
Notifications
You must be signed in to change notification settings - Fork 348
Closed
Labels
CleanupCleanup tasksCleanup tasks
Description
Problem
When we run buf lint --error-format=json on an empty proto file, we get the following JSON output:
{
"path": "path/to/file.proto",
"type": "PACKAGE_DEFINED",
"message": "Files must have a package defined."
}
{
"path": "path/to/file.proto",
"type": "SYNTAX_SPECIFIED",
"message": "Files must have a syntax explicitly specified. If no syntax is specified, the file defaults to \"proto2\"."
}This output is missing 4 fields start_line, start_column, end_line and end_column which makes consuming this JSON by third party tools problematic as one may easily forget to check if these fields are not null before assigning them as numeric values.
Proposition
Add the missing fields with value 1 so that the output becomes:
{
"path": "path/to/file.proto",
"start_line": 1,
"start_column": 1,
"end_line": 1,
"end_column": 1,
"type": "PACKAGE_DEFINED",
"message": "Files must have a package defined."
}
{
"path": "path/to/file.proto",
"start_line": 1,
"start_column": 1,
"end_line": 1,
"end_column": 1,
"type": "SYNTAX_SPECIFIED",
"message": "Files must have a syntax explicitly specified. If no syntax is specified, the file defaults to \"proto2\"."
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
CleanupCleanup tasksCleanup tasks