Skip to content

Comments

Organized and cleaned up the Code#587

Open
RISHII-BHARADHWAJ wants to merge 2 commits intoaboutcode-org:developfrom
RISHII-BHARADHWAJ:develop
Open

Organized and cleaned up the Code#587
RISHII-BHARADHWAJ wants to merge 2 commits intoaboutcode-org:developfrom
RISHII-BHARADHWAJ:develop

Conversation

@RISHII-BHARADHWAJ
Copy link

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.

@chinyeungli
Copy link
Contributor

@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.

@RISHII-BHARADHWAJ
Copy link
Author

@chinyeungli Ye sure

Signed-off-by: Rishii <whitedevilrishii@gmail.com>
…t and template issues, update tests for AboutCode Toolkit
Copy link
Contributor

@chinyeungli chinyeungli left a comment

Choose a reason for hiding this comment

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

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],
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

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 (
Copy link
Contributor

Choose a reason for hiding this comment

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

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 (
Copy link
Contributor

Choose a reason for hiding this comment

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

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
Copy link
Contributor

Choose a reason for hiding this comment

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

It’s a duplicated import.

@@ -0,0 +1,1491 @@
============================= test session starts ==============================
Copy link
Contributor

Choose a reason for hiding this comment

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

what's this file about?

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