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 Aug 30, 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 Powerm4 August 30, 2023 08:11
match = functionNameRegex.match(line)
if match:
if match := functionNameRegex.match(line):
Copy link
Author

Choose a reason for hiding this comment

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

Function matchFunctionName refactored with the following changes:

Comment on lines -102 to +101
isLastParameter = True if end is not None and end == ')' else False
isLastParameter = end is not None and end == ')'
Copy link
Author

Choose a reason for hiding this comment

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

Function matchParameter refactored with the following changes:

Comment on lines -107 to +106
return True if openingCurlyBraceRegex.match(line) is not None else False
return openingCurlyBraceRegex.match(line) is not None
Copy link
Author

Choose a reason for hiding this comment

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

Function matchOpeningCurlyBrace refactored with the following changes:

Comment on lines -121 to +120
if not matchOpeningCurlyBrace(nextLine):
return 0
return i + 1
return 0 if not matchOpeningCurlyBrace(nextLine) else i + 1
Copy link
Author

Choose a reason for hiding this comment

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

Function getFunctionDeclarationLength refactored with the following changes:

Comment on lines -128 to +125
parameterInfos = []
for i in range(length):
parameterInfos.append(matchParameter(remainingLines[i]))
return parameterInfos
return [matchParameter(remainingLines[i]) for i in range(length)]
Copy link
Author

Choose a reason for hiding this comment

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

Function getParameterInfos refactored with the following changes:

Comment on lines -36 to +38
def get_random_file_index ():
def get_random_file_index():
n = len (files)
if n == 0:
return -1
else:
return random_gen.randrange (n)
return -1 if n == 0 else random_gen.randrange (n)
Copy link
Author

Choose a reason for hiding this comment

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

Function get_random_file_index refactored with the following changes:

Comment on lines -43 to +42
def get_random_directory_index ():
def get_random_directory_index():
n = len (directories)
if n == 0:
return -1
else:
return random_gen.randrange (n)

def get_random_filename ():
chars = []
for i in range (20):
chars.append ("abcdefghijklmnopqrstuvwxyz"[random_gen.randrange (26)])
return -1 if n == 0 else random_gen.randrange (n)
Copy link
Author

Choose a reason for hiding this comment

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

Function get_random_directory_index refactored with the following changes:

def get_random_filename ():
chars = []
for i in range (20):
chars.append ("abcdefghijklmnopqrstuvwxyz"[random_gen.randrange (26)])
return -1 if n == 0 else random_gen.randrange (n)

def get_random_filename():
chars = [
"abcdefghijklmnopqrstuvwxyz"[random_gen.randrange(26)]
for _ in range(20)
]
extension = extensions[random_gen.randrange (len (extensions))]
filename = "".join (chars) + extension
return filename
return "".join (chars) + extension
Copy link
Author

Choose a reason for hiding this comment

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

Function get_random_filename refactored with the following changes:

pull bot pushed a commit that referenced this pull request Mar 4, 2024
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