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

Run the black formatter #869

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Run the black formatter #869

merged 2 commits into from
Jun 10, 2024

Conversation

oddstr13
Copy link
Member

@oddstr13 oddstr13 commented Jun 2, 2024

The changes in this PR are made by running the run_black.sh from #868
The .git-blame-ignore-revs allow git blame to stay useful even after massive formatting changes such as this.

@oddstr13 oddstr13 added the cleanup Non-functional code cleanup/readability/formatting label Jun 2, 2024
Copy link

codecov bot commented Jun 2, 2024

Codecov Report

Attention: Patch coverage is 2.75911% with 2749 lines in your changes missing coverage. Please review.

Project coverage is 21.48%. Comparing base (bcad924) to head (4834688).
Report is 18 commits behind head on master.

Files Patch % Lines
jellyfin_kodi/entrypoint/default.py 0.00% 268 Missing ⚠️
jellyfin_kodi/views.py 0.00% 264 Missing ⚠️
jellyfin_kodi/objects/actions.py 0.41% 242 Missing ⚠️
jellyfin_kodi/objects/tvshows.py 0.82% 241 Missing ⚠️
jellyfin_kodi/objects/music.py 0.00% 181 Missing ⚠️
jellyfin_kodi/full_sync.py 0.00% 145 Missing ⚠️
jellyfin_kodi/helper/playutils.py 0.71% 139 Missing ⚠️
jellyfin_kodi/library.py 2.25% 130 Missing ⚠️
jellyfin_kodi/objects/movies.py 0.81% 121 Missing ⚠️
jellyfin_kodi/entrypoint/service.py 1.69% 116 Missing ⚠️
... and 34 more
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #869   +/-   ##
=======================================
  Coverage   21.48%   21.48%           
=======================================
  Files          63       63           
  Lines        8628     8628           
  Branches     1587     1587           
=======================================
  Hits         1854     1854           
  Misses       6750     6750           
  Partials       24       24           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

if server['Id'] == new_credentials['Servers'][0]['Id']:
server = new_credentials['Servers'][0]
if server["Id"] == new_credentials["Servers"][0]["Id"]:
server = new_credentials["Servers"][0]

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable server is not used.

def select_servers(self, state=None):

state = state or self.connect_manager.connect({'enableAutoLogin': False})
state = state or self.connect_manager.connect({"enableAutoLogin": False})

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable state is not used.
Comment on lines +555 to +557
for song in self.jellyfin_db.get_item_by_parent_id(
*values(obj, QUEM.get_item_by_parent_song_obj)
):

Check warning

Code scanning / CodeQL

Unnecessary 'else' clause in loop Warning

This 'for' statement has a redundant 'else' as no 'break' is present in the body.
Comment on lines +569 to +571
for album in self.jellyfin_db.get_item_by_parent_id(
*values(obj, QUEM.get_item_by_parent_album_obj)
):

Check warning

Code scanning / CodeQL

Unnecessary 'else' clause in loop Warning

This 'for' statement has a redundant 'else' as no 'break' is present in the body.
Comment on lines +576 to +578
for song in self.jellyfin_db.get_item_by_parent_id(
*values(temp_obj, QUEM.get_item_by_parent_song_obj)
):

Check warning

Code scanning / CodeQL

Unnecessary 'else' clause in loop Warning

This 'for' statement has a redundant 'else' as no 'break' is present in the body.

# Remove any series pooling episodes
for episode in self.jellyfin_db.get_media_by_parent_id(obj['Id']):
self.remove_episode(episode[2], episode[3], obj['Id'])
for episode in self.jellyfin_db.get_media_by_parent_id(obj["Id"]):

Check warning

Code scanning / CodeQL

Unnecessary 'else' clause in loop Warning

This 'for' statement has a redundant 'else' as no 'break' is present in the body.
on_error=lambda ws, error: self.on_error(ws, error))
self.wsc = websocket.WebSocketApp(
wsc_url,
on_open=lambda ws: self.on_open(ws),

Check notice

Code scanning / CodeQL

Unnecessary lambda Note

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.
self.wsc = websocket.WebSocketApp(
wsc_url,
on_open=lambda ws: self.on_open(ws),
on_message=lambda ws, message: self.on_message(ws, message),

Check notice

Code scanning / CodeQL

Unnecessary lambda Note

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.
wsc_url,
on_open=lambda ws: self.on_open(ws),
on_message=lambda ws, message: self.on_message(ws, message),
on_error=lambda ws, error: self.on_error(ws, error),

Check notice

Code scanning / CodeQL

Unnecessary lambda Note

This 'lambda' is just a simple wrapper around a callable object. Use that object directly.
Copy link
Member Author

Choose a reason for hiding this comment

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

intentional to work around issue in the websocket library. may or may not still be needed, but shouldn't hurt anything except using a stack frame extra

"artwork",
"title",
"content",
"type" "inprogress.content",

Check warning

Code scanning / CodeQL

Implicit string concatenation in a list Warning

Implicit string concatenation. Maybe missing a comma?
@oddstr13
Copy link
Member Author

oddstr13 commented Jun 2, 2024

Might be worth going thru the CodeQL and SonarCloud warnings thrown here, but none of them are new for this PR, as it provides no functional changes.

@oddstr13 oddstr13 force-pushed the black branch 3 times, most recently from ef5628a to 781b2c2 Compare June 8, 2024 03:56
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots
D Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@oddstr13 oddstr13 merged commit 94e44d4 into jellyfin:master Jun 10, 2024
9 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Non-functional code cleanup/readability/formatting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant