Repository: webscopeio/license.sh

Issue:
Package whitelisting
I am trying to white-list certain packages but they are still failing

```
bunyan-format - 0.2.1 - {'type': 'MIT', 'url': 'https://github.com/thlorenz/bunyan-format/blob/master/LICENSE'}
```
```
pako - 1.0.10 - (MIT AND Zlib)
```

They are present in the config
```
{
  "projects": [
    {
      "directory": ".",
      "type": "npm"
    }
  ],
  "whitelist": [
    "ISC",
    "Unlicense",
    "CC-BY-4.0",
    "BSD-3-Clause",
    "MIT",
    "BSD-2-Clause",
    "(BSD-3-Clause OR GPL-2.0)",
    "CC0-1.0",
    "Apache 2",
    "Apache-2",
    "(MIT AND Zlib)",
    "(MIT AND BSD-3-Clause)",
    "BSD",
    "MPL-2.0",
    "Apache-2.0",
    "CC-BY-3.0",
    "{'type': 'MIT', 'url': 'https://github.com/thlorenz/bunyan-format/blob/master/LICENSE'}",
    "MIT/X11",
    "(MIT AND CC-BY-3.0)"
  ]
}
```

Discussion:

Patch:
diff --git a/license_sh/helpers.py b/license_sh/helpers.py
index a7c4139..686f980 100644
--- a/license_sh/helpers.py
+++ b/license_sh/helpers.py
@@ -97,7 +97,7 @@ def is_license_ok(license_text, whitelist):
     try:
         license = licensing.parse(license_text)
     except:
-        return license_text in whitelist
+        return f"{license_text}" in whitelist
 
     if license is None:
         return None


Test patch:
diff --git a/tests/runners/test_helpers.py b/tests/runners/test_helpers.py
index 3e77f28..1a0f966 100644
--- a/tests/runners/test_helpers.py
+++ b/tests/runners/test_helpers.py
@@ -6,6 +6,7 @@ from anytree.exporter import DictExporter
 from license_sh.helpers import (
     flatten_dependency_tree,
     annotate_dep_tree,
+    is_license_ok,
     extract_npm_license,
     get_npm_license_from_licenses_array,
     UNKNOWN,
@@ -225,6 +226,29 @@ class NpmRunnerTestCase(unittest.TestCase):
         _, unknown_licenses = annotate_dep_tree(tree, whitelist, ignored_packages)
         self.assertSetEqual(set({"GPL"}), unknown_licenses)
 
+    def test_is_license_ok_simple(self):
+        self.assertEqual(is_license_ok("MIT", ["MIT"]), True)
+
+    def test_is_license_ok_negative(self):
+        self.assertEqual(is_license_ok("MIT", [""]), False)
+
+    def test_is_license_ok_brackets(self):
+        self.assertEqual(is_license_ok("MIT AND Zlib", ["MIT", "Zlib"]), True)
+
+    def test_is_license_ok_json(self):
+        self.assertEqual(
+            is_license_ok(
+                {
+                    "type": "MIT",
+                    "url": "https://github.com/thlorenz/bunyan-format/blob/master/LICENSE",
+                },
+                [
+                    "{'type': 'MIT', 'url': 'https://github.com/thlorenz/bunyan-format/blob/master/LICENSE'}"
+                ],
+            ),
+            True,
+        )
+
     def test_extract_npm_license_None_data(self):
         name = extract_npm_license(None, None)
         self.assertEqual(name, None)