Skip to content

Please add support for ShellCheck JSON format #75

Open
@jamacku

Description

@jamacku

ShellCheck can suggest a possible solution of the reported defect. Unfortunately, this data isn't available in gcc format. It would be nice if csdiff could parse ShellCheck JSON format, which contains possible fix under fix key.

Example:

{
  "comments": [
    {
      "file": "myotherscript",
      "line": 2,
      "endLine": 2,
      "column": 1,
      "endColumn": 2,
      "level": "error",
      "code": 1035,
      "message": "You need a space after the [ and before the ].",
      "fix": null
    },
    {
      "file": "myscript",
      "line": 2,
      "endLine": 2,
      "column": 6,
      "endColumn": 8,
      "level": "warning",
      "code": 2039,
      "message": "In POSIX sh, echo flags are undefined.",
      "fix": null
    },
    {
      "file": "myscript",
      "line": 2,
      "endLine": 2,
      "column": 9,
      "endColumn": 11,
      "level": "info",
      "code": 2086,
      "message": "Double quote to prevent globbing and word splitting.",
      "fix": {
        "replacements": [
          {
            "line": 2,
            "endLine": 2,
            "precedence": 7,
            "insertionPoint": "afterEnd",
            "column": 9,
            "replacement": "\"",
            "endColumn": 9
          },
          {
            "line": 2,
            "endLine": 2,
            "precedence": 7,
            "insertionPoint": "beforeStart",
            "column": 11,
            "replacement": "\"",
            "endColumn": 11
          }
        ]
      }
    }
  ]
}

Having this kind of information would be very useful for:

Thanks for working on this project! 👍

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions