Skip to content

changed dict to OrderedDict so as to align the scans in correct order. - #156

Merged
steven-esser merged 1 commit into
aboutcode-org:developfrom
pratik0316:ChangingDict
Apr 13, 2020
Merged

changed dict to OrderedDict so as to align the scans in correct order.#156
steven-esser merged 1 commit into
aboutcode-org:developfrom
pratik0316:ChangingDict

Conversation

@pratik0316

Copy link
Copy Markdown
Collaborator

In this Pr I changed the Dict to OrderedDict when we are making the index files.

I changed this because :

1.To make the deltas to appear in the manner in which it is present in the scancode scans,Currently the deltas are appearing in a jumbled order.
Example: a delta having a new file path as src/jarabe/view/viewhelp_webkit2.py(link) is appearing before a delta having a path as src/jarabe/view/viewhelp_webkit1.py(link), the paths are not arranged properly.It would look better if deltas are arranged as per their paths in an top-down fashion of their paths
2.Moreover when we will port deltacode to python3 then Dict by default places the keys as if they appear sorted by insertion order, In Python 2 Dict places the keys in jumbled order.However using Ordered Dict will restore the uniformity in both Py2 and Py3. ref
If we do not use ordered dict we may fail for some test cases when we are using py2 in CI 's

… and accordingly modified the test cases expected json files

Signed-off-by: Pratikrocks <pratikrocks.dey11@gmail.com>
@steven-esser
steven-esser merged commit 2742956 into aboutcode-org:develop Apr 13, 2020
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.

2 participants