Add flake8 config and fix some code style issues - #1431
Merged
Merged
Conversation
Member
|
LGTM. I'm going to test it for a week to make sure it doesn't cause any major issues. It'll be nice to have flake8 run with |
elelay
requested changes
Nov 4, 2022
elelay
left a comment
Member
There was a problem hiding this comment.
not sure about some removed imports
elelay
self-requested a review
November 7, 2022 15:22
elelay
approved these changes
Nov 7, 2022
elelay
left a comment
Member
There was a problem hiding this comment.
good to go 👍
thanks for this work!
Contributor
Author
|
Squashed the fixup. |
Member
|
The following hunk was modified in #1382. Would it be easier to remove the hunk from this PR or rebase it in #1382? @@ -621,8 +621,8 @@ def get_playback_url(/sitelet?url=https%3A%2F%2Fgithub.com%2Fgpodder%2Fgpodder%2Fpull%2Fself%2C%2520config%3DNone%2C%2520allow_partial%3DFalse):
"""
url = self.local_filename(create=False)
- if (allow_partial and url is not None and
- os.path.exists(url + '.partial')):
+ if (allow_partial and url is not None
+ and os.path.exists(url + '.partial')):
return url + '.partial'
if url is None or not os.path.exists(url): |
Member
|
And the following hunk was modified in #1374. @@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
-from gi.repository import Gdk, GdkPixbuf, Gtk
+from gi.repository import Gdk, Gtk
import gpodder
from gpodder import util |
Contributor
Author
Set project-wide max-line-length and ignore indentation errors E126 and E128, and warning W503 (Line break occurred before a binary operator) for now.
Fixes flake8 error F401. Most errors were fixed by running autoflake -i -r --remove-all-unused-imports . which also removes unnecessary 'pass' statements, some by hand-editing.
Fixed by running autopep8 -i -r --select=W504 . and some hand tuning.
Contributor
Author
|
Rebased to master and fixed the conflicts. |
Member
|
Thank you for adding this. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I think it would be nice to have a stricter machine validated code style for gPodder (i.e. I started using autolinting on my editor and everything is red). This PR adds a flake8 config section to setup.cfg with ignores for some errors and warnings, and fixes (mostly automatically made) for some others.
There are still 157 flake8 errors in gPodder after the fixes and ignores, but it's a start. This is also probably really boring to review, but here goes.