Skip to content

Rewritten assert statements for more explicit checks - #574

Closed
Dhruv276R wants to merge 2 commits into
aboutcode-org:developfrom
Dhruv276R:replace_assert_stats
Closed

Rewritten assert statements for more explicit checks#574
Dhruv276R wants to merge 2 commits into
aboutcode-org:developfrom
Dhruv276R:replace_assert_stats

Conversation

@Dhruv276R

@Dhruv276R Dhruv276R commented Jan 14, 2025

Copy link
Copy Markdown

Fixes issue:

I have changed the assert statements to if and raise statements. It was a good first issue.

@pombredanne

Copy link
Copy Markdown
Member

Can you add a reference link in your commit message before your signoff:
Reference: https://github.com/aboutcode-org/aboutcode/issues/175

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks, can you amend your commit to add your DCO signoff?

Note that the other test failures may not be your making, but rather because of #576

Comment thread src/attributecode/attrib.py Outdated
Comment thread src/attributecode/attrib.py
@Dhruv276R

Dhruv276R commented Jan 18, 2025

Copy link
Copy Markdown
Author

@pombredanne
Can you tell me what to do exactly? I am new in open source and willing to make better contributions

lic_score = about.license_score.value
assert len(lic_key) == len(lic_name)
assert len(lic_key) == len(lic_score)
if len(lic_key) != len(lic_name):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

May be you can extract a variable?

Suggested change
if len(lic_key) != len(lic_name):
len_lics = len(lic_key)
if len_lics != len(lic_name):

and then use it in the messages and other tests below?

@pombredanne pombredanne left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you! Could you squash your commits, rewrite a proper commit message as explained in our documentation, add your DCO signoff, and force push?

@Dhruv276R

Copy link
Copy Markdown
Author

Yeah I tried that but force pushing didn't seem to work for me. Let me do it again.

@chinyeungli

Copy link
Copy Markdown
Contributor

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.

3 participants