Repository: spdx/ntia-conformance-checker

Issue:
Spelling: Minimum vs mininum
There's a small spelling mistake in the function ntia_mininum_elements_compliant and therefore also in the README.

Suggestion:
ntia_minimum_elements_compliant

Hints from issue comments:
@jspeed-meyers: @thireo, thank you for the bug report. PR's welcome

But this will be a breaking change, won't it? @goneall, should I bump the version to 2.x? What do you advise? This silly typo is definitely my fault. Oops.  @thireo: Let me know if I need to change anything in my PR or commit. 
I'm not entirely sure of the correct way of doing this.@jspeed-meyers: Thank you, @thireo. One minor request: Can you please use the `black` formatter? See the PR thread for further info. @jspeed-meyers: @goneall -- friendly ping. What do you think is the best approach to handling this breaking change?@goneall: @jspeed-meyers - yes, probably a breaking change - even though pretty minor. Since it is breaking, we should probably go to the next major version number. Is there any other planned changes that may be breaking we should include in a major release?@jspeed-meyers: @goneall: I don't currently have any plans for other breaking changes. Given that, should we delay cutting a new release for a couple of months just to see if there any other breaking changes? Or should I merge the associated PR here and cut a release ASAP?

I'll make sure the release notes clearly explain this change, BTW.@goneall: > should I merge the associated PR here and cut a release ASAP?

Unless @thireo would like these changes merged in quickly, I think we should wait 3 to 4 weeks and see if there are any other breaking changes.

I added a 2.0.0 milestone to the project, so we can tag any PR's and Issues with the release milestone.

@thireo - OK to wait a month or two for this fix?@jspeed-meyers: Thank you for the wise advice, @goneall. And thank you for creating the 2.0.0 milestone. That sounds like a plan to me. @thireo: I'm okay waiting a month for this to be merged. I'll just use my own patch meanwhile :)@jspeed-meyers: Okay, I merged this fix. But I will not cut a version until early April.

Solution patch:
diff --git a/README.md b/README.md
index 42d47cd..73d5ea0 100644
--- a/README.md
+++ b/README.md
@@ -72,7 +72,7 @@ import ntia_conformance_checker as ntia
 
 sbom = ntia.SbomChecker("SBOM_filepath")
 
-print(sbom.ntia_mininum_elements_compliant)
+print(sbom.ntia_minimum_elements_compliant)
 ```
 
 Additional properties and methods associated with `SbomChecker()` can be found in [`sbom_checker.py`](ntia_conformance_checker/sbom_checker.py).
diff --git a/ntia_conformance_checker/__init__.py b/ntia_conformance_checker/__init__.py
index c491035..f23fae3 100644
--- a/ntia_conformance_checker/__init__.py
+++ b/ntia_conformance_checker/__init__.py
@@ -1,2 +1,3 @@
 """Export functions for usage as library."""
+
 from ntia_conformance_checker.sbom_checker import SbomChecker
diff --git a/ntia_conformance_checker/main.py b/ntia_conformance_checker/main.py
index fbec417..5ed7bda 100644
--- a/ntia_conformance_checker/main.py
+++ b/ntia_conformance_checker/main.py
@@ -74,7 +74,7 @@ def main():
         html_output = sbom.output_html()
         print(html_output)
     # 0 indicates success
-    sys.exit(0 if sbom.ntia_mininum_elements_compliant else 1)
+    sys.exit(0 if sbom.ntia_minimum_elements_compliant else 1)
 
 
 if __name__ == "__main__":
diff --git a/ntia_conformance_checker/sbom_checker.py b/ntia_conformance_checker/sbom_checker.py
index f2892ee..090d164 100644
--- a/ntia_conformance_checker/sbom_checker.py
+++ b/ntia_conformance_checker/sbom_checker.py
@@ -21,7 +21,7 @@ class SbomChecker:
         self.parsing_error = []
         self.doc = self.parse_file()
         if not self.doc:
-            self.ntia_mininum_elements_compliant = False
+            self.ntia_minimum_elements_compliant = False
         else:
             self.validation_messages = None
             if validate:
@@ -37,7 +37,7 @@ class SbomChecker:
             self.components_without_identifiers = (
                 self.get_components_without_identifiers()
             )
-            self.ntia_mininum_elements_compliant = (
+            self.ntia_minimum_elements_compliant = (
                 self.check_ntia_minimum_elements_compliance()
             )
 
@@ -138,7 +138,7 @@ class SbomChecker:
         # pylint: disable=line-too-long
         if self.parsing_error:
             print(
-                f"\nIs this SBOM NTIA minimum element conformant? {self.ntia_mininum_elements_compliant}\n"
+                f"\nIs this SBOM NTIA minimum element conformant? {self.ntia_minimum_elements_compliant}\n"
             )
             print(
                 "The provided document couldn't be parsed, check for ntia minimum elements couldn't be performed.\n"
@@ -149,7 +149,7 @@ class SbomChecker:
 
         else:
             print(
-                f"\nIs this SBOM NTIA minimum element conformant? {self.ntia_mininum_elements_compliant}\n"
+                f"\nIs this SBOM NTIA minimum element conformant? {self.ntia_minimum_elements_compliant}\n"
             )
             print("Individual elements                            | Status")
             print("-------------------------------------------------------")
@@ -257,7 +257,7 @@ class SbomChecker:
         else:
             result["parsingError"] = self.parsing_error
 
-        result["isNtiaConformant"] = self.ntia_mininum_elements_compliant
+        result["isNtiaConformant"] = self.ntia_minimum_elements_compliant
 
         return result
 
@@ -266,7 +266,7 @@ class SbomChecker:
         if self.doc:
             result = (
                 f" <h2>NTIA Conformance Results</h2> "
-                f"<h3>Conformant: {self.ntia_mininum_elements_compliant} </h3>"
+                f"<h3>Conformant: {self.ntia_minimum_elements_compliant} </h3>"
                 f"<table> <tr> "
                 f"<th>Individual Elements</th> <th>Conformant</th> </tr> "
                 f"<tr> <td>All component names provided</td>"
@@ -295,7 +295,7 @@ class SbomChecker:
         else:
             result = f"""
             <h2>NTIA Conformance Results</h2>
-            <h3>Conformant: {self.ntia_mininum_elements_compliant} </h3>
+            <h3>Conformant: {self.ntia_minimum_elements_compliant} </h3>
             <p>The provided document couldn't be parsed, check for ntia minimum elements couldn't be performed.</p>
             <p>The following SPDXParsingError was raised:<p><ul>"""
             for error in self.parsing_error:


Test patch:
diff --git a/tests/test_checker.py b/tests/test_checker.py
index f379b5f..72a2065 100644
--- a/tests/test_checker.py
+++ b/tests/test_checker.py
@@ -25,7 +25,7 @@ def test_sbomchecker_no_errors(test_file):
     assert not sbom.components_without_versions
     assert not sbom.components_without_suppliers
     assert not sbom.components_without_identifiers
-    assert sbom.ntia_mininum_elements_compliant
+    assert sbom.ntia_minimum_elements_compliant
 
 
 dirname = os.path.join(os.path.dirname(__file__), "data", "missing_author_name")
@@ -40,7 +40,7 @@ def test_sbomchecker_missing_author_name(test_file):
     the document does not contain a creator."""
     sbom_check = sbom_checker.SbomChecker(test_file)
 
-    assert not sbom_check.ntia_mininum_elements_compliant
+    assert not sbom_check.ntia_minimum_elements_compliant
     assert sbom_check.parsing_error
 
 
@@ -54,7 +54,7 @@ def test_sbomchecker_missing_timestamp(test_file):
     the document does not contain a created date."""
     sbom_check = sbom_checker.SbomChecker(test_file)
 
-    assert not sbom_check.ntia_mininum_elements_compliant
+    assert not sbom_check.ntia_minimum_elements_compliant
     assert sbom_check.parsing_error
 
 
@@ -78,7 +78,7 @@ def test_sbomchecker_missing_dependency_relationships(test_file):
     assert not sbom.components_without_versions
     assert not sbom.components_without_suppliers
     assert not sbom.components_without_identifiers
-    assert not sbom.ntia_mininum_elements_compliant
+    assert not sbom.ntia_minimum_elements_compliant
 
 
 dirname = os.path.join(os.path.dirname(__file__), "data", "missing_component_version")
@@ -99,7 +99,7 @@ def test_sbomchecker_missing_component_version(test_file):
     TestCase().assertCountEqual(sbom.components_without_versions, ["glibc"])
     assert not sbom.components_without_suppliers
     assert not sbom.components_without_identifiers
-    assert not sbom.ntia_mininum_elements_compliant
+    assert not sbom.ntia_minimum_elements_compliant
 
 
 dirname = os.path.join(os.path.dirname(__file__), "data", "missing_supplier_name")
@@ -118,7 +118,7 @@ def test_sbomchecker_missing_supplier_name(test_file):
     assert not sbom.components_without_versions
     TestCase().assertCountEqual(sbom.components_without_suppliers, ["Jena", "Saxon"])
     assert not sbom.components_without_identifiers
-    assert not sbom.ntia_mininum_elements_compliant
+    assert not sbom.ntia_minimum_elements_compliant
 
 
 dirname = os.path.join(os.path.dirname(__file__), "data", "missing_unique_identifiers")
@@ -133,7 +133,7 @@ def test_sbomchecker_missing_unique_identifiers(test_file):
     the document contains an element without SPDXID."""
     sbom_check = sbom_checker.SbomChecker(test_file)
 
-    assert not sbom_check.ntia_mininum_elements_compliant
+    assert not sbom_check.ntia_minimum_elements_compliant
     assert sbom_check.parsing_error