Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix parsing error #356

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

viveksahu26
Copy link
Collaborator

closes #353

This PR trigger a parser error, if any. Earlier it wasn't.

See below:

$ go run main.go compliance -n -D  tt.json                       
2024-11-19T22:40:51.888+0530	DEBUG	engine/compliance.go:30	engine.ComplianceRun()
2024-11-19T22:40:51.888+0530	DEBUG	engine/compliance.go:36	Config: &{Path:[tt.json] Categories:[] Features:[] JSON:false Basic:false Detailed:false Pdf:false Spdx:false Cdx:false Recurse:false Debug:true ConfigPath: Ntia:true Bsi:false BsiV2:false Oct:false Fsct:false Color:false}
2024-11-19T22:40:51.888+0530	DEBUG	engine/compliance.go:86	engine.getSbomDocument()
2024-11-19T22:40:51.888+0530	DEBUG	engine/compliance.go:135	failed to create sbom document for  :tt.json

2024-11-19T22:40:51.888+0530	DEBUG	engine/compliance.go:136	invalid character '\n' in string literal

failed to parse tt.json : invalid character '\n' in string literal
2024-11-19T22:40:51.888+0530	DEBUG	engine/compliance.go:40	getSbomDocument failed for file :tt.json

failed to get sbom document for tt.json
Error: invalid character '\n' in string literal
Usage:
  sbomqs compliance [flags]

Examples:
 sbomqs compliance  < --ntia | --bsi | --bsi-v2 | --fsct | --oct >  [--basic | --json]   <SBOM file>

  # Check a NTIA minimum elements compliance against a SBOM in a table output
  sbomqs compliance --ntia samples/sbomqs-spdx-syft.json

  # Check a BSI TR-03183-2 v1.1 compliance against a SBOM in a table output
  sbomqs compliance --bsi samples/sbomqs-spdx-syft.json

  # Check a BSI TR-03183-2 v2.0.0 compliance against a SBOM in a table output
  sbomqs compliance --bsi-v2 samples/sbomqs-spdx-syft.json

   # Check a Framing Software Component Transparency (v3) compliance against a SBOM in a table output
  sbomqs compliance --fsct samples/sbomqs-spdx-syft.json

  # Check a OpenChain Telco compliance against a SBOM in a JSON output
  sbomqs compliance --oct --json samples/sbomqs-spdx-syft.json

   # Check a Framing Software Component Transparency (v3) compliance against a SBOM in a table colorful output
  sbomqs compliance --fsct --color samples/sbomqs-spdx-syft.json



Flags:
  -b, --basic      output in basic format
  -c, --bsi        BSI TR-03183-2 (v1.1)
  -s, --bsi-v2     BSI TR-03183-2 (v2.0.0)
  -l, --color      output in colorful
  -D, --debug      debug logging
  -d, --detailed   output in detailed format(default)
  -f, --fsct       Framing Software Component Transparency (v3)
  -h, --help       help for compliance
  -j, --json       output in json format
  -n, --ntia       NTIA minimum elements (July 12, 2021)
  -t, --oct        OpenChain Telco SBOM (v1.0)

exit status 1

Signed-off-by: Vivek Kumar Sahu <[email protected]>
@viveksahu26 viveksahu26 marked this pull request as draft November 25, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A JSON file containing raw newline characters does not produce an error
1 participant