Skip to content

Sourcery refactored master branch#1

Open
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master
Open

Sourcery refactored master branch#1
sourcery-ai[bot] wants to merge 1 commit intomasterfrom
sourcery/master

Conversation

@sourcery-ai
Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot commented Oct 2, 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 Dabou06 October 2, 2023 09:01
for movie_title in movies:
movies_instances.append(Movie(movie_title))

movies_instances.extend(Movie(movie_title) for movie_title in movies)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function get_movies refactored with the following changes:

for movie_title in movies:
movies_instances.append(Movie(movie_title))

movies_instances.extend(Movie(movie_title) for movie_title in movies)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function get_movies refactored with the following changes:

for movie_title in movies:
movies_instances.append(Movie(movie_title))

movies_instances.extend(Movie(movie_title) for movie_title in movies)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function get_movies refactored with the following changes:

for movie_title in movies:
movies_instances.append(Movie(movie_title))

movies_instances.extend(Movie(movie_title) for movie_title in movies)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function get_movies refactored with the following changes:

movie = Movie(title=movie_title)
result = movie.add_to_movies()
if result:
if result := movie.add_to_movies():
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function App.add_movie refactored with the following changes:

Comment on lines -0 to +4
a = "J'ai une classe de " + str(30) + " élèves"
b = str(10) + " + " + "5" + " est égal à " + str(15)
a = f"J'ai une classe de {30} élèves"
b = f"{10} + 5 est égal à {15}"
c = 10 + int("5")
d = "L'addition de 10 + 5 est égal à " + str(10 + 5) No newline at end of file
d = f"L'addition de 10 + 5 est égal à {str(10 + 5)}" No newline at end of file
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 1-4 refactored with the following changes:

Comment on lines -2 to +14
nombres_pairs = []
for i in nombres:
if i % 2 == 0:
nombres_pairs.append(i)

nombres_pairs = [i for i in nombres if i % 2 == 0]
print(nombres_pairs)

# ---------------------------------------------------- #

nombres = range(-10, 10)
nombres_positifs = []
for i in nombres:
if i >= 0:
nombres_positifs.append(i)

nombres_positifs = [i for i in nombres if i >= 0]
print(nombres_positifs)

# ---------------------------------------------------- #

nombres = range(5)
nombres_doubles = []
for i in nombres:
nombres_doubles.append(i * 2)

nombres_doubles = [i * 2 for i in nombres]
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Lines 2-25 refactored with the following changes:

return -1
else:
return User.DB.insert(self.__dict__)
return -1 if self.exists() else User.DB.insert(self.__dict__)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function User.save refactored with the following changes:

return -1
else:
return User.DB.insert(self.__dict__)
return -1 if self.exists() else User.DB.insert(self.__dict__)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Function User.save refactored with the following changes:

return -1
else:
return User.DB.insert(self.__dict__)
return -1 if self.exists() else User.DB.insert(self.__dict__)
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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