Skip to content

Parsing JSON files as XML in CLI #675

Open
@alexandrakoller

Description

@alexandrakoller

Describe the bug
When analysing JSON files with dots in their names (e.g., file.test.config.json), DevSkim CLI incorrectly attempts to parse them as XML, resulting in a parsing error: [13:40:06 ERR] Failed to parse Data at the root level is invalid. Line 1, position 1. as a XML document: null

To Reproduce
Steps to reproduce the behavior:

  1. Create a JSON file with dots in its name, such as file.test.config.json.
  2. Run the DevSkim analyze command on this file. I have run devskim analyze -I ./src -s Important -E true -g **/bin/**,**/obj/**,**/.git/**,**/node_modules/** -x Verbose
  3. Observe the error message indicating a failure to parse the file as XML.

Expected behavior
DevSkim should be able to recognise and parse a JSON file.

Screenshots
Image

Versions(please complete the following information):

  • OS: Windows 10 (10.0.22631)
  • Devskim Version 1.0.51+210b5d121e

Additional context
N/A

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions