Skip to content
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

Create JSON-compatible errors #455

Merged
merged 2 commits into from
May 3, 2022
Merged

Create JSON-compatible errors #455

merged 2 commits into from
May 3, 2022

Conversation

JohnnyMorganz
Copy link
Owner

--output-format=json will now output all messages in JSON format.
Structure:

{
    "type": "error", // or "warn"/"info"/"debug" etc. and "parse_error"
    "message": "XYZ"
}

and if type == "parse_error" we also have a filename and location field like

{
    "type": "parse_error",
    "message": "XYZ",
    "filename": "src/test.lua",
    "location": {
        "start": 0, // byte offset from start of file
        "start_line": 0,
        "start_column": 0,
        "end": 0, // byte offsets from start of file
        "end_line": 0,
        "end_column": 0,
    }
}

Closes #453

@codecov
Copy link

codecov bot commented May 3, 2022

Codecov Report

Merging #455 (6c0ef00) into master (11a4c8c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #455   +/-   ##
=======================================
  Coverage   96.44%   96.44%           
=======================================
  Files          14       14           
  Lines        5257     5257           
=======================================
  Hits         5070     5070           
  Misses        187      187           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 11a4c8c...6c0ef00. Read the comment docs.

@JohnnyMorganz JohnnyMorganz merged commit a3234a2 into master May 3, 2022
@JohnnyMorganz JohnnyMorganz deleted the json-errors branch May 3, 2022 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON-compatible error outputs
1 participant