Skip to content

Commit

Permalink
Merge pull request #175 from thireo/spelling-fix
Browse files Browse the repository at this point in the history
Fixed spelling
  • Loading branch information
jspeed-meyers authored Mar 6, 2024
2 parents 62f332a + 10bcb27 commit 252d740
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions ntia_conformance_checker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
"""Export functions for usage as library."""

from ntia_conformance_checker.sbom_checker import SbomChecker
2 changes: 1 addition & 1 deletion ntia_conformance_checker/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__":
Expand Down
14 changes: 7 additions & 7 deletions ntia_conformance_checker/sbom_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def __init__(self, file, validate=True):
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:
Expand All @@ -37,7 +37,7 @@ def __init__(self, file, validate=True):
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()
)

Expand Down Expand Up @@ -138,7 +138,7 @@ def print_table_output(self):
# 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"
Expand All @@ -149,7 +149,7 @@ def print_table_output(self):

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("-------------------------------------------------------")
Expand Down Expand Up @@ -257,7 +257,7 @@ def output_json(self):
else:
result["parsingError"] = self.parsing_error

result["isNtiaConformant"] = self.ntia_mininum_elements_compliant
result["isNtiaConformant"] = self.ntia_minimum_elements_compliant

return result

Expand All @@ -266,7 +266,7 @@ def output_html(self):
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>"
Expand Down Expand Up @@ -295,7 +295,7 @@ def output_html(self):
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:
Expand Down
14 changes: 7 additions & 7 deletions tests/test_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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


Expand All @@ -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


Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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")
Expand All @@ -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


Expand Down

0 comments on commit 252d740

Please sign in to comment.