Skip to content

Doug/fix diff scan license options #40

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions socketdev/fullscans/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,9 @@ def from_dict(cls, data: dict) -> "LicenseMatch":
@dataclass
class LicenseDetail:
authors: List[str]
charEnd: int
charStart: int
errorData: str
filepath: str
match_strength: int
filehash: str
provenance: str
spdxDisj: List[List[LicenseMatch]]

Expand All @@ -360,14 +358,13 @@ def to_dict(self):
@classmethod
def from_dict(cls, data: dict) -> "LicenseDetail":
return cls(
spdxDisj=data["spdxDisj"],
authors=data["authors"],
charEnd=data["charEnd"],
charStart=data["charStart"],
errorData=data["errorData"],
provenance=data["provenance"],
filepath=data["filepath"],
match_strength=data["match_strength"],
filehash=data["filehash"],
provenance=data["provenance"],
spdxDisj=[[LicenseMatch.from_dict(match) for match in group] for group in data["spdxDisj"]],

)


Expand Down Expand Up @@ -766,10 +763,10 @@ def stream_diff(
before: str,
after: str,
use_types: bool = True,
include_license_details: bool = False,
include_license_details: str = "true",
**kwargs,
) -> Union[dict, StreamDiffResponse]:
path = f"orgs/{org_slug}/full-scans/diff?before={before}&after={after}&{include_license_details}"
path = f"orgs/{org_slug}/full-scans/diff?before={before}&after={after}&include_license_details={include_license_details}"
if kwargs:
for key, value in kwargs.items():
path += f"&{key}={value}"
Expand Down
2 changes: 1 addition & 1 deletion socketdev/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "2.1.5"
__version__ = "2.1.7"
Loading