Skip to content

Sourcery refactored master branch #1

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

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

Conversation

sourcery-ai[bot]
Copy link

@sourcery-ai sourcery-ai bot commented Feb 28, 2023

Branch master 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 master branch, then run:

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

Help us improve this pull request!

@sourcery-ai sourcery-ai bot requested a review from laith43d February 28, 2023 01:29
cmd_folder = os.path.join(BASE_DIR + '/cli', 'commands')
cmd_folder = os.path.join(f'{BASE_DIR}/cli', 'commands')
Copy link
Author

Choose a reason for hiding this comment

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

Lines 28-28 refactored with the following changes:

Comment on lines -34 to +38
rv = []
for filename in os.listdir(cmd_folder):
if filename.endswith('.py') and \
filename.startswith('cmd_'):
rv.append(filename[4:-3])
rv = [
filename[4:-3]
for filename in os.listdir(cmd_folder)
if filename.endswith('.py') and filename.startswith('cmd_')
]
Copy link
Author

Choose a reason for hiding this comment

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

Function CLI.list_commands refactored with the following changes:

Comment on lines -46 to +51
mod = __import__('cli.commands.cmd_' + name, locals = None, globals = None, fromlist = ['cli'])
mod = __import__(
f'cli.commands.cmd_{name}',
locals=None,
globals=None,
fromlist=['cli'],
)
Copy link
Author

Choose a reason for hiding this comment

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

Function CLI.get_command refactored with the following changes:

with open(f'api/__init__.py', 'a+') as f:
with open('api/__init__.py', 'a+') as f:
Copy link
Author

Choose a reason for hiding this comment

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

Function make_api refactored with the following changes:

with open(f'models/__init__.py', 'a+') as f:
with open('models/__init__.py', 'a+') as f:
Copy link
Author

Choose a reason for hiding this comment

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

Function make_model refactored with the following changes:

Comment on lines -64 to +66
handler = RotatingFileHandler(LOG_DIR + '/app.log', maxBytes = 1000000, backupCount = 5)
handler = RotatingFileHandler(
f'{LOG_DIR}/app.log', maxBytes=1000000, backupCount=5
)
Copy link
Author

Choose a reason for hiding this comment

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

Lines 64-64 refactored with the following changes:

exts = []
for ext in _mime_types:
if mime_type in _mime_types[ext]:
exts.append(ext)
return exts
return [ext for ext in _mime_types if mime_type in _mime_types[ext]]
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_extensions refactored with the following changes:

if equal is NotImplemented:
return NotImplemented
return not equal
return NotImplemented if equal is NotImplemented else not equal
Copy link
Author

Choose a reason for hiding this comment

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

Function UserMixin.__ne__ refactored with the following changes:

return '<User {}>'.format(self.username)
return f'<User {self.username}>'
Copy link
Author

Choose a reason for hiding this comment

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

Function User.__repr__ refactored with the following changes:

result = cls.query().where('username', username).first_or_fail()
if result:
if result := cls.query().where('username', username).first_or_fail():
Copy link
Author

Choose a reason for hiding this comment

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

Function User.lookup 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