-
-
Notifications
You must be signed in to change notification settings - Fork 217
Add flake8 config and fix some code style issues #1431
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
Conversation
|
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
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure about some removed imports
elelay
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good to go 👍
thanks for this work!
|
Squashed the fixup. |
|
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(self, config=None, allow_partial=False):
"""
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): |
|
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 |
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.
|
Rebased to master and fixed the conflicts. |
|
Thank you for adding this. |
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.