Support C-style comments for configuration JSON parsing

1. Add and set ignore_comment to true to all nlohmann::json::parse().
2. Add remove_c_comments() in `validate_configs.py` to remove C-style
   comments before loading.
3. Attempt to reformat comments in the `autojson.py` taking liberal
   short-cuts which are documented in the script.

Supported comment examples:

- Single-line style comments
```
{
  // Single-line style comment (new line)
  "Key": "Value" // Single-line comment (end of content)
}
```

- Multi-line style comments
```
{
  /* Multi-line style comment */
  /*
   * Multi-line style comments
   */
}
```

Tested on harma system with manual applied patch below, which contains
a c-style comment in harma-pttv.json file.
Link: https://gerrit.openbmc.org/c/openbmc/entity-manager/+/67469/25

- scripts/autojson.py
Run autojson.py on harma-pttv.json, the output as same as original file.

- scripts/validate_configs.py
Run validate_configs.py passed.

- EntityManager service
EntityManager service loads and probes harma-pttv.json successfully.
```
root@harma:~# busctl introspect xyz.openbmc_project.EntityManager \
> /xyz/openbmc_project/inventory/system/board/Harma_PTTV \
> xyz.openbmc_project.Inventory.Item.Board
NAME                                     TYPE      SIGNATURE RESULT/VALUE                             FLAGS
.Name                                    property  s         "Harma PTTV"                             emits-change
.Probe                                   property  s         "xyz.openbmc_project.FruDevice({\'BOA... emits-change
.Type                                    property  s         "Board"                                  emits-change
```

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Ib235f2aa6a724615dc4c8184577f57abda8e17a6
diff --git a/src/entity_manager.cpp b/src/entity_manager.cpp
index af229d3..f023e64 100644
--- a/src/entity_manager.cpp
+++ b/src/entity_manager.cpp
@@ -534,7 +534,7 @@
                 "No schema avaliable, cannot validate.");
         }
         nlohmann::json schema = nlohmann::json::parse(schemaFile, nullptr,
-                                                      false);
+                                                      false, true);
         if (schema.is_discarded())
         {
             std::cerr << "Schema not legal" << *type << ".json\n";
@@ -846,7 +846,8 @@
         std::exit(EXIT_FAILURE);
         return false;
     }
-    nlohmann::json schema = nlohmann::json::parse(schemaStream, nullptr, false);
+    nlohmann::json schema = nlohmann::json::parse(schemaStream, nullptr, false,
+                                                  true);
     if (schema.is_discarded())
     {
         std::cerr
@@ -863,7 +864,7 @@
             std::cerr << "unable to open " << jsonPath.string() << "\n";
             continue;
         }
-        auto data = nlohmann::json::parse(jsonStream, nullptr, false);
+        auto data = nlohmann::json::parse(jsonStream, nullptr, false, true);
         if (data.is_discarded())
         {
             std::cerr << "syntax error in " << jsonPath.string() << "\n";
diff --git a/src/perform_probe.cpp b/src/perform_probe.cpp
index 71280d8..102351e 100644
--- a/src/perform_probe.cpp
+++ b/src/perform_probe.cpp
@@ -152,7 +152,7 @@
             // convert single ticks and single slashes into legal json
             boost::replace_all(commandStr, "'", "\"");
             boost::replace_all(commandStr, R"(\)", R"(\\)");
-            auto json = nlohmann::json::parse(commandStr, nullptr, false);
+            auto json = nlohmann::json::parse(commandStr, nullptr, false, true);
             if (json.is_discarded())
             {
                 std::cerr << "dbus command syntax error " << commandStr << "\n";