Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sourcery refactored main branch #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Nov 20, 2023

Branch main refactored by Sourcery.

If you're happy with these changes, merge this Pull Request using the Squash and merge strategy.

See our documentation here.

Run Sourcery locally

Reduce the feedback loop during development by using the Sourcery editor plugin:

Review changes via command line

To manually merge these changes, make sure you're on the main branch, then run:

git fetch origin sourcery/main
git merge --ff-only FETCH_HEAD
git reset HEAD^

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from huths0lo November 20, 2023 13:49
string = ''
i = 0
while i < 100:
string += f'{random.randint(0,9)}'
i += 1

string = ''.join(f'{random.randint(0, 9)}' for _ in range(100))
Copy link
Author

Choose a reason for hiding this comment

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

Lines 4-9 refactored with the following changes:

Comment on lines 17 to 23
if i + 1 == target:
end_point = length # Catch any left-over bytes in the last segment.
else:
end_point = (i + 1) * seg_size
end_point = length if i + 1 == target else (i + 1) * seg_size
slice = bytes[start_point:end_point]
segments.append(slice)
i += 1

checksums = [reduce(lambda acc, curr: acc ^ curr, segment) for segment in segments]


return checksums No newline at end of file
return [reduce(lambda acc, curr: acc ^ curr, segment) for segment in segments]
Copy link
Author

Choose a reason for hiding this comment

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

Function compress refactored with the following changes:

This removes the following comments ( why? ):

# Catch any left-over bytes in the last segment.

Comment on lines -11 to +15
for word in words:
styled_words.append(word.title())
styled_words.extend(word.title() for word in words)
elif style == 'lowercase':
for word in words:
styled_words.append(word.lower())
styled_words.extend(word.lower() for word in words)
elif style == 'uppercase':
for word in words:
styled_words.append(word.upper())
styled_words.extend(word.upper() for word in words)
Copy link
Author

Choose a reason for hiding this comment

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

Function to_styled refactored with the following changes:

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.

0 participants