Skip to content

Description is empty even though input has it #7

@wiktor-k

Description

@wiktor-k

Hi,

I'm trying to use the tool to get codeclimate for Gitlab and it seems in some cases the tool doesn't output description.

Input file:

{
  "$schema": "https://schemastore.azurewebsites.net/schemas/json/sarif-2.1.0.json",
  "runs": [
    {
      "columnKind": "unicodeCodePoints",
      "results": [
        {
          "fixes": [
            {
              "artifactChanges": [
                {
                  "artifactLocation": {
                    "uri": "./packet/src/framing.rs"
                  },
                  "replacements": [
                    {
                      "deletedRegion": {
                        "endColumn": 30,
                        "endLine": 268,
                        "startColumn": 23,
                        "startLine": 268
                      },
                      "insertedContent": {
                        "text": "writer"
                      }
                    },
                    {
                      "deletedRegion": {
                        "endColumn": 30,
                        "endLine": 268,
                        "startColumn": 23,
                        "startLine": 268
                      },
                      "insertedContent": {
                        "text": "written"
                      }
                    }
                  ]
                }
              ],
              "description": {
                "markdown": "`writter` should be `writer`, `written`"
              }
            }
          ],
          "level": "error",
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "./packet/src/framing.rs"
                },
                "region": {
                  "endColumn": 30,
                  "endLine": 268,
                  "startColumn": 23,
                  "startLine": 268
                }
              }
            }
          ],
          "message": {
            "markdown": "`writter` should be `writer`, `written`" // <-- this is here
          }
        }
      ],
      "tool": {
        "driver": {
          "informationUri": "https://github.com/crate-ci/typos",
          "name": "typos"
        }
      }
    }
  ],
  "version": "2.1.0"
}

Output file:

[    {
        "description": "", // <---- this is empty
        "fingerprint": "3364d54845ad6be9d1bb46018c125b69",
        "severity": "major",
        "location": {
            "path": "./packet/src/framing.rs",
            "lines": {
                "begin": 268
            }
        }
    }
]

Converted via npx sarif-codeclimate --input /tmp/sarif.json --output /tmp/code.json.

FWIW npx sarif-codeclimate --version prints 2.0.0.

Thank you for your time! 👋

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions