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

remove unwanted files dependencies #176

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Pratikrocks
Copy link
Collaborator

remove unwanted files dependencies
Signed-off-by: Pratik Dey [email protected]

This was linked to issues Jul 17, 2021
@Pratikrocks Pratikrocks requested a review from steven-esser July 17, 2021 12:53
Signed-off-by: Pratik Dey <[email protected]>
@Pratikrocks Pratikrocks linked an issue Jul 17, 2021 that may be closed by this pull request
@@ -422,6 +422,7 @@ def test_Delta_create_object_removed(self):
assert 'removed' in delta.factors
assert delta.score == 0

@pytest.mark.xfail(reason='Tests no longer required having None paths')
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping it xfail for now as these test it requires File models and since it is just one line in the File I thought it would be quite trivial to mae a separate .json object to scan it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are removing the File object, I think we can just remove these tests, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we can !

Comment on lines -308 to -314
class ScanException(Exception):
"""
Named exception for JSON file (1) containing no 'scancode_version'
attribute, (2) containing old version of ScanCode, or (3) containing no
'scancode_options'/'--info' attribute.
"""
pass
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be needed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually they are inbuilt in VirtualCodebase so i felt they might not be needed

@@ -422,6 +422,7 @@ def test_Delta_create_object_removed(self):
assert 'removed' in delta.factors
assert delta.score == 0

@pytest.mark.xfail(reason='Tests no longer required having None paths')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are removing the File object, I think we can just remove these tests, right?

@@ -48,7 +48,7 @@ def write_json(deltacode, outfile, all_delta_types=False):
# ('old_scan_options', deltacode.old_scan_options),
('deltacode_options', deltacode.options),
('deltacode_version', __version__),
('deltacode_errors', collect_errors(deltacode)),
('deltacode_errors', []),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why have this?

Signed-off-by: Pratik Dey <[email protected]>
Signed-off-by: Pratik Dey <[email protected]>
@Pratikrocks
Copy link
Collaborator Author

Updated!

@Pratikrocks Pratikrocks requested a review from steven-esser July 28, 2021 04:19
self._populate(new_path, old_path)

self.new_scan_options = []
self.old_scan_options = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget where we stand on this, but if the VirtualCodebase objects contain this information, I do not see the value of our DeltaCode object containing it as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

VirtualCodebase is actually having all the resources but Delta objects will only contains only the respective deltas

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.

Remove redundant File model Remove redundant Scan model Add function to handle loading 2 codebases.
2 participants