tokei icon indicating copy to clipboard operation
tokei copied to clipboard

C# has two different names when changing output formats

Open cglong opened this issue 1 year ago • 1 comments

When running tokei .\test.cs --output json and formatting the output, I noticed this:

{
  "C#": {
    "blanks": 1,
    "children": {},
    "code": 8,
    "comments": 0,
    "inaccurate": false,
    "reports": [
      {
        "name": ".\\test.cs",
        "stats": {
          "blanks": 1,
          "blobs": {},
          "code": 8,
          "comments": 0
        }
      }
    ]
  },
  "Total": {
    "blanks": 1,
    "children": {
      "CSharp": [
        {
          "name": ".\\test.cs",
          "stats": {
            "blanks": 1,
            "blobs": {},
            "code": 8,
            "comments": 0
          }
        }
      ]
    },
    "code": 8,
    "comments": 0,
    "inaccurate": false,
    "reports": []
  }
}

Note that C# is called C# at the top level, but when part of Total, it's called CSharp 🙂

cglong avatar Mar 03 '23 06:03 cglong

Thank you for your issue! That's a nice catch. The fix should be straightforward, to have LanguageType always use the human friendly variant when possible.

I don't have time to work on it right now but I would be able to accept a PR if anyone is interested

XAMPPRocky avatar Mar 03 '23 16:03 XAMPPRocky