diff --git a/CHANGELOG.md b/CHANGELOG.md index 015802a..d8c99d0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -49,6 +49,7 @@ Add your changes below. - featured_playlists - category_playlists - Added FAQ entry for inaccessible playlists +- Workflow to check for f-strings ### Changed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 054f1e0..752418e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,19 +29,18 @@ $ source env/bin/activate ### Lint + pip install .[test] + To automatically fix some of the code style: - pip install autopep8 autopep8 --in-place --aggressive --recursive . To verify the code style: - pip install flake8 flake8 . To make sure if the import lists are stored correctly: - pip install isort isort . -c Sort them automatically with: diff --git a/setup.py b/setup.py index c1ac288..912aba0 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,9 @@ extra_reqs = { 'pymemcache>=3.5.2' ], 'test': [ + 'autopep8>=2.3.2', 'flake8>=7.1.1', + 'flake8-string-format>=0.3.0', 'isort>=5.13.2' ] } diff --git a/spotipy/client.py b/spotipy/client.py index c814757..b622b14 100644 --- a/spotipy/client.py +++ b/spotipy/client.py @@ -1244,10 +1244,8 @@ class Spotify: if they follow the playlist. Maximum: 5 ids. """ - endpoint = "playlists/{}/followers/contains?ids={}" - return self._get( - endpoint.format(playlist_id, ",".join(user_ids)) - ) + endpoint = f"playlists/{playlist_id}/followers/contains?ids={','.join(user_ids)}" + return self._get(endpoint) def me(self): """ Get detailed profile information about the current user. diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 14b2b6d..7c26f95 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -1224,19 +1224,21 @@ class RequestHandler(BaseHTTPRequestHandler): self._write("

Invalid request

") return - self._write(""" + self._write(f""" -

Authentication status: {}

+

Authentication status: {status}

This window can be closed. - + -""".format(status)) +""") def _write(self, text): return self.wfile.write(text.encode("utf-8"))