XAMPPRocky / tokei

Count your code, quickly.
Other
10.88k stars 527 forks source link

C# has two different names when changing output formats #975

Open cglong opened 1 year ago

cglong commented 1 year ago

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 🙂

XAMPPRocky commented 1 year ago

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