Organized and cleaned up the Code#587
Organized and cleaned up the Code#587RISHII-BHARADHWAJ wants to merge 2 commits intoaboutcode-org:developfrom
Conversation
|
@RISHII-BHARADHWAJ Thank you for your efforts on this. It appears that the test code has not been updated, which is causing the tests to fail. Please make the necessary corrections. |
|
@chinyeungli Ye sure |
2805a4e to
33ee25f
Compare
Signed-off-by: Rishii <whitedevilrishii@gmail.com>
33ee25f to
2b5c8e1
Compare
…t and template issues, update tests for AboutCode Toolkit
chinyeungli
left a comment
There was a problem hiding this comment.
Thank you for the work on this, and apologies for the delayed review.
Please refer to the comments.
| rendered = template.render( | ||
| abouts=abouts, | ||
| common_licenses=COMMON_LICENSES, | ||
| common_licenses=[lic.key for lic in licenses_list], |
There was a problem hiding this comment.
The COMMON_LICENSES (https://github.com/aboutcode-org/aboutcode-toolkit/blob/develop/src/attributecode/licenses.py) contains commonly encountered licenses in general, not the licenses actually detected within a specific codebase
| # limitations under the License. | ||
| # ============================================================================ | ||
|
|
||
| import saneyaml |
There was a problem hiding this comment.
Why do I need to import saneyaml if it isn’t used?
| from attributecode.util import ungroup_licenses | ||
| from attributecode.util import ungroup_licenses_from_sctk | ||
| from attributecode import Error, CRITICAL, ERROR, WARNING, INFO | ||
| from attributecode.util import ( |
There was a problem hiding this comment.
For consistency, it would be better to keep those import statements inline rather than grouped in a set.
| from attributecode import saneyaml | ||
| from attributecode.util import csv | ||
| from attributecode.util import replace_tab_with_spaces | ||
| from attributecode.util import ( |
There was a problem hiding this comment.
For consistency, it would be better to keep those import statements inline rather than grouped in a set.
| from attributecode import WARNING | ||
| from attributecode import Error | ||
| from attributecode import __version__ | ||
| from attributecode import Error |
There was a problem hiding this comment.
It’s a duplicated import.
| @@ -0,0 +1,1491 @@ | |||
| ============================= test session starts ============================== | |||
There was a problem hiding this comment.
what's this file about?
I have made the necessary changes to the files util.py,models.py and transform.py.
Hope this solves the issue of duplication of code and makes it look more organized and clean.