-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting an "Unexpected token: error when parsing the JSON output. #59
Comments
Seems related this: sqlfluff/sqlfluff-github-actions#15 So maybe not an issue here? |
Not sure, your JSON seems valid... 🤔 const result = JSON.parse(`[
{
"file": "models/linting_test.sql",
"line": 9,
"start_column": 5,
"end_column": 5,
"title": "SQLFluff",
"message": "L003: Indent expected and not found compared to line #4",
"annotation_level": "failure"
},
{
"file": "models/linting_test.sql",
"line": 10,
"start_column": 5,
"end_column": 5,
"title": "SQLFluff",
"message": "L003: Indent expected and not found compared to line #4",
"annotation_level": "failure"
},
{
"file": "models/linting_test.sql",
"line": 14,
"start_column": 5,
"end_column": 5,
"title": "SQLFluff",
"message": "L036: Select targets should be on a new line unless there is only one select target.",
"annotation_level": "failure"
},
{
"file": "models/linting_test.sql",
"line": 15,
"start_column": 5,
"end_column": 5,
"title": "SQLFluff",
"message": "L003: Indent expected and not found compared to line #10",
"annotation_level": "failure"
},
{
"file": "models/linting_test.sql",
"line": 16,
"start_column": 5,
"end_column": 5,
"title": "SQLFluff",
"message": "L003: Indent expected and not found compared to line #10",
"annotation_level": "failure"
},
{
"file": "models/linting_test.sql",
"line": 18,
"start_column": 15,
"end_column": 15,
"title": "SQLFluff",
"message": "L009: Files must end with a single trailing newline.",
"annotation_level": "failure"
}
]`)
console.log({result}) Might be an encoding issue or an invalid character somewhere (non-breaking space, zero-width space...). Lines 123 to 124 in 20b64ec
|
Hi @Mogztter, I actually ended up fixing this by implementing the fix described here: sqlfluff/sqlfluff-github-actions#15 (comment) Seems like it might be more of a dbt issue. |
I'm getting the error
SyntaxError: Unexpected token : in JSON at position 2
when running against the following JSON:The text was updated successfully, but these errors were encountered: