Skip to content

Conversation

myteron
Copy link
Contributor

@myteron myteron commented Sep 19, 2025

part of #531

Signed-off-by: Helge Wehder <[email protected]>
@myteron myteron changed the title adding 789 as part of #531 pySCG: adding 783 as part of #531 Sep 22, 2025
@s19110
Copy link
Contributor

s19110 commented Sep 23, 2025

reviewing

Copy link
Contributor

@BartKaras1128 BartKaras1128 left a comment

Choose a reason for hiding this comment

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

Just have one comment on the "noncompliant01.py" description.

Copy link
Contributor

@s19110 s19110 left a comment

Choose a reason for hiding this comment

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

Left a couple of suggestions. The bibliography is partially incorrect.
Overall, this is a great rule for the introductory section since it touches on some programming basics!

Comment on lines 3 to 17
"""Compliant Code Example"""


def label(number: int):
if number < 0:
return "neg"
if number % 2 == 0:
return "even"
if number < 5:
return "small"
return "big"


for number in range(-3, 3):
print(f"{number} = {label(number)}")

This comment was marked as resolved.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Have not tried but we could potentially update the noncompliant01.py to support multiple labels.

Copy link
Contributor

@s19110 s19110 left a comment

Choose a reason for hiding this comment

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

After the changes, the rule looks good to me.

@myteron
Copy link
Contributor Author

myteron commented Sep 29, 2025

2x+1 merging

@myteron myteron merged commit 667e33a into ossf:main Sep 29, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants