Lack of PEP8 compliance in bitmessagemain.py #167

Closed
opened 2013-05-26 05:14:07 +02:00 by sysr-q · 3 comments
sysr-q commented 2013-05-26 05:14:07 +02:00 (Migrated from github.com)

Let me just quote what happens when I run pep8 bitmessagemain.py:

bitmessagemain.py:7:80: E501 line too long (122 > 79 characters)
bitmessagemain.py:11:80: E501 line too long (82 > 79 characters)
bitmessagemain.py:11:52: E261 at least two spaces before inline comment
bitmessagemain.py:11:53: E262 inline comment should start with '# '
bitmessagemain.py:12:80: E501 line too long (188 > 79 characters)
bitmessagemain.py:12:47: E261 at least two spaces before inline comment
bitmessagemain.py:12:48: E262 inline comment should start with '# '
bitmessagemain.py:13:80: E501 line too long (261 > 79 characters)
bitmessagemain.py:13:43: E261 at least two spaces before inline comment
bitmessagemain.py:13:44: E262 inline comment should start with '# '
bitmessagemain.py:14:80: E501 line too long (80 > 79 characters)
bitmessagemain.py:14:51: E261 at least two spaces before inline comment
bitmessagemain.py:14:52: E262 inline comment should start with '# '
bitmessagemain.py:15:48: E261 at least two spaces before inline comment
bitmessagemain.py:15:49: E262 inline comment should start with '# '
bitmessagemain.py:16:80: E501 line too long (181 > 79 characters)
bitmessagemain.py:16:58: E261 at least two spaces before inline comment
bitmessagemain.py:16:59: E262 inline comment should start with '# '
bitmessagemain.py:17:80: E501 line too long (151 > 79 characters)
bitmessagemain.py:17:41: E261 at least two spaces before inline comment
bitmessagemain.py:17:42: E262 inline comment should start with '# '
bitmessagemain.py:37:14: E261 at least two spaces before inline comment
bitmessagemain.py:37:15: E262 inline comment should start with '# '
bitmessagemain.py:44:80: E501 line too long (92 > 79 characters)
bitmessagemain.py:44:14: E261 at least two spaces before inline comment
bitmessagemain.py:44:15: E262 inline comment should start with '# '
bitmessagemain.py:48:28: E261 at least two spaces before inline comment
bitmessagemain.py:48:29: E262 inline comment should start with '# '
bitmessagemain.py:51:80: E501 line too long (137 > 79 characters)
bitmessagemain.py:52:1: E302 expected 2 blank lines, found 1
bitmessagemain.py:56:19: E231 missing whitespace after ','
bitmessagemain.py:63:80: E501 line too long (88 > 79 characters)
bitmessagemain.py:64:80: E501 line too long (112 > 79 characters)
bitmessagemain.py:64:69: E261 at least two spaces before inline comment
bitmessagemain.py:64:70: E262 inline comment should start with '# '
bitmessagemain.py:68:80: E501 line too long (99 > 79 characters)
bitmessagemain.py:72:80: E501 line too long (83 > 79 characters)
bitmessagemain.py:74:80: E501 line too long (181 > 79 characters)
bitmessagemain.py:75:80: E501 line too long (87 > 79 characters)
bitmessagemain.py:77:80: E501 line too long (83 > 79 characters)
bitmessagemain.py:81:80: E501 line too long (83 > 79 characters)
bitmessagemain.py:83:80: E501 line too long (95 > 79 characters)
bitmessagemain.py:86:80: E501 line too long (104 > 79 characters)
bitmessagemain.py:91:80: E501 line too long (92 > 79 characters)
bitmessagemain.py:94:80: E501 line too long (97 > 79 characters)
bitmessagemain.py:97:80: E501 line too long (92 > 79 characters)
bitmessagemain.py:98:80: E501 line too long (87 > 79 characters)
bitmessagemain.py:99:80: E501 line too long (172 > 79 characters)
bitmessagemain.py:99:32: E261 at least two spaces before inline comment
bitmessagemain.py:99:33: E262 inline comment should start with '# '
bitmessagemain.py:100:80: E501 line too long (93 > 79 characters)
bitmessagemain.py:101:80: E501 line too long (96 > 79 characters)
bitmessagemain.py:102:80: E501 line too long (96 > 79 characters)
bitmessagemain.py:103:80: E501 line too long (110 > 79 characters)
bitmessagemain.py:105:80: E501 line too long (80 > 79 characters)
bitmessagemain.py:106:80: E501 line too long (91 > 79 characters)
bitmessagemain.py:109:80: E501 line too long (96 > 79 characters)
bitmessagemain.py:112:80: E501 line too long (92 > 79 characters)
bitmessagemain.py:113:80: E501 line too long (87 > 79 characters)
bitmessagemain.py:114:80: E501 line too long (172 > 79 characters)
bitmessagemain.py:114:32: E261 at least two spaces before inline comment
bitmessagemain.py:114:33: E262 inline comment should start with '# '
bitmessagemain.py:115:80: E501 line too long (93 > 79 characters)
bitmessagemain.py:116:80: E501 line too long (96 > 79 characters)
bitmessagemain.py:117:80: E501 line too long (96 > 79 characters)
bitmessagemain.py:118:80: E501 line too long (110 > 79 characters)
bitmessagemain.py:120:80: E501 line too long (80 > 79 characters)
bitmessagemain.py:125:80: E501 line too long (92 > 79 characters)
bitmessagemain.py:125:37: E261 at least two spaces before inline comment
bitmessagemain.py:128:80: E501 line too long (105 > 79 characters)
bitmessagemain.py:128:34: E231 missing whitespace after ','
bitmessagemain.py:128:39: E231 missing whitespace after ','
bitmessagemain.py:128:44: E231 missing whitespace after ','
bitmessagemain.py:128:62: E231 missing whitespace after ','
bitmessagemain.py:131:80: E501 line too long (83 > 79 characters)
bitmessagemain.py:135:80: E501 line too long (105 > 79 characters)
bitmessagemain.py:135:34: E231 missing whitespace after ','
bitmessagemain.py:135:39: E231 missing whitespace after ','
bitmessagemain.py:135:44: E231 missing whitespace after ','
bitmessagemain.py:135:62: E231 missing whitespace after ','
bitmessagemain.py:142:80: E501 line too long (91 > 79 characters)
bitmessagemain.py:144:80: E501 line too long (83 > 79 characters)
bitmessagemain.py:145:80: E501 line too long (248 > 79 characters)
bitmessagemain.py:145:118: E261 at least two spaces before inline comment
bitmessagemain.py:150:80: E501 line too long (142 > 79 characters)
bitmessagemain.py:153:80: E501 line too long (115 > 79 characters)
bitmessagemain.py:154:80: E501 line too long (108 > 79 characters)
bitmessagemain.py:154:64: E231 missing whitespace after ','
bitmessagemain.py:157:80: E501 line too long (107 > 79 characters)
bitmessagemain.py:157:98: E203 whitespace before ','
bitmessagemain.py:157:99: E231 missing whitespace after ','
bitmessagemain.py:158:80: E501 line too long (135 > 79 characters)
bitmessagemain.py:161:80: E501 line too long (98 > 79 characters)
bitmessagemain.py:163:80: E501 line too long (97 > 79 characters)
bitmessagemain.py:164:80: E501 line too long (108 > 79 characters)
bitmessagemain.py:165:80: E501 line too long (145 > 79 characters)
bitmessagemain.py:169:80: E501 line too long (95 > 79 characters)
bitmessagemain.py:171:80: E501 line too long (87 > 79 characters)
bitmessagemain.py:172:80: E501 line too long (245 > 79 characters)
bitmessagemain.py:172:122: E261 at least two spaces before inline comment
bitmessagemain.py:177:80: E501 line too long (139 > 79 characters)
bitmessagemain.py:180:80: E501 line too long (154 > 79 characters)
bitmessagemain.py:183:80: E501 line too long (402 > 79 characters)
bitmessagemain.py:184:1: E302 expected 2 blank lines, found 1
bitmessagemain.py:189:5: E303 too many blank lines (2)
bitmessagemain.py:190:80: E501 line too long (176 > 79 characters)
bitmessagemain.py:191:80: E501 line too long (88 > 79 characters)
bitmessagemain.py:197:18: E261 at least two spaces before inline comment
bitmessagemain.py:200:80: E501 line too long (87 > 79 characters)
bitmessagemain.py:206:9: E303 too many blank lines (2)
bitmessagemain.py:207:80: E501 line too long (184 > 79 characters)
bitmessagemain.py:208:80: E501 line too long (92 > 79 characters)
bitmessagemain.py:212:80: E501 line too long (120 > 79 characters)
bitmessagemain.py:215:14: E231 missing whitespace after ','
bitmessagemain.py:215:20: E231 missing whitespace after ','
bitmessagemain.py:217:80: E501 line too long (238 > 79 characters)
bitmessagemain.py:220:80: E501 line too long (82 > 79 characters)
bitmessagemain.py:223:18: E231 missing whitespace after ','
bitmessagemain.py:223:24: E231 missing whitespace after ','
bitmessagemain.py:226:1: W293 blank line contains whitespace
bitmessagemain.py:228:23: E231 missing whitespace after ','
bitmessagemain.py:228:28: E231 missing whitespace after ','
bitmessagemain.py:228:33: E231 missing whitespace after ','
bitmessagemain.py:228:36: E231 missing whitespace after ','
bitmessagemain.py:232:80: E501 line too long (84 > 79 characters)
bitmessagemain.py:232:29: E261 at least two spaces before inline comment
bitmessagemain.py:233:23: E231 missing whitespace after ','

That's not even the best part of it. You can see the full 2443 line PEP8 error list here.

This shouldn't be so insanely un-pythonic. Some work should be done on cleaning up the source code - maybe some classes, those are helpful.

Let me just quote what happens when I run `pep8 bitmessagemain.py`: ``` bitmessagemain.py:7:80: E501 line too long (122 > 79 characters) bitmessagemain.py:11:80: E501 line too long (82 > 79 characters) bitmessagemain.py:11:52: E261 at least two spaces before inline comment bitmessagemain.py:11:53: E262 inline comment should start with '# ' bitmessagemain.py:12:80: E501 line too long (188 > 79 characters) bitmessagemain.py:12:47: E261 at least two spaces before inline comment bitmessagemain.py:12:48: E262 inline comment should start with '# ' bitmessagemain.py:13:80: E501 line too long (261 > 79 characters) bitmessagemain.py:13:43: E261 at least two spaces before inline comment bitmessagemain.py:13:44: E262 inline comment should start with '# ' bitmessagemain.py:14:80: E501 line too long (80 > 79 characters) bitmessagemain.py:14:51: E261 at least two spaces before inline comment bitmessagemain.py:14:52: E262 inline comment should start with '# ' bitmessagemain.py:15:48: E261 at least two spaces before inline comment bitmessagemain.py:15:49: E262 inline comment should start with '# ' bitmessagemain.py:16:80: E501 line too long (181 > 79 characters) bitmessagemain.py:16:58: E261 at least two spaces before inline comment bitmessagemain.py:16:59: E262 inline comment should start with '# ' bitmessagemain.py:17:80: E501 line too long (151 > 79 characters) bitmessagemain.py:17:41: E261 at least two spaces before inline comment bitmessagemain.py:17:42: E262 inline comment should start with '# ' bitmessagemain.py:37:14: E261 at least two spaces before inline comment bitmessagemain.py:37:15: E262 inline comment should start with '# ' bitmessagemain.py:44:80: E501 line too long (92 > 79 characters) bitmessagemain.py:44:14: E261 at least two spaces before inline comment bitmessagemain.py:44:15: E262 inline comment should start with '# ' bitmessagemain.py:48:28: E261 at least two spaces before inline comment bitmessagemain.py:48:29: E262 inline comment should start with '# ' bitmessagemain.py:51:80: E501 line too long (137 > 79 characters) bitmessagemain.py:52:1: E302 expected 2 blank lines, found 1 bitmessagemain.py:56:19: E231 missing whitespace after ',' bitmessagemain.py:63:80: E501 line too long (88 > 79 characters) bitmessagemain.py:64:80: E501 line too long (112 > 79 characters) bitmessagemain.py:64:69: E261 at least two spaces before inline comment bitmessagemain.py:64:70: E262 inline comment should start with '# ' bitmessagemain.py:68:80: E501 line too long (99 > 79 characters) bitmessagemain.py:72:80: E501 line too long (83 > 79 characters) bitmessagemain.py:74:80: E501 line too long (181 > 79 characters) bitmessagemain.py:75:80: E501 line too long (87 > 79 characters) bitmessagemain.py:77:80: E501 line too long (83 > 79 characters) bitmessagemain.py:81:80: E501 line too long (83 > 79 characters) bitmessagemain.py:83:80: E501 line too long (95 > 79 characters) bitmessagemain.py:86:80: E501 line too long (104 > 79 characters) bitmessagemain.py:91:80: E501 line too long (92 > 79 characters) bitmessagemain.py:94:80: E501 line too long (97 > 79 characters) bitmessagemain.py:97:80: E501 line too long (92 > 79 characters) bitmessagemain.py:98:80: E501 line too long (87 > 79 characters) bitmessagemain.py:99:80: E501 line too long (172 > 79 characters) bitmessagemain.py:99:32: E261 at least two spaces before inline comment bitmessagemain.py:99:33: E262 inline comment should start with '# ' bitmessagemain.py:100:80: E501 line too long (93 > 79 characters) bitmessagemain.py:101:80: E501 line too long (96 > 79 characters) bitmessagemain.py:102:80: E501 line too long (96 > 79 characters) bitmessagemain.py:103:80: E501 line too long (110 > 79 characters) bitmessagemain.py:105:80: E501 line too long (80 > 79 characters) bitmessagemain.py:106:80: E501 line too long (91 > 79 characters) bitmessagemain.py:109:80: E501 line too long (96 > 79 characters) bitmessagemain.py:112:80: E501 line too long (92 > 79 characters) bitmessagemain.py:113:80: E501 line too long (87 > 79 characters) bitmessagemain.py:114:80: E501 line too long (172 > 79 characters) bitmessagemain.py:114:32: E261 at least two spaces before inline comment bitmessagemain.py:114:33: E262 inline comment should start with '# ' bitmessagemain.py:115:80: E501 line too long (93 > 79 characters) bitmessagemain.py:116:80: E501 line too long (96 > 79 characters) bitmessagemain.py:117:80: E501 line too long (96 > 79 characters) bitmessagemain.py:118:80: E501 line too long (110 > 79 characters) bitmessagemain.py:120:80: E501 line too long (80 > 79 characters) bitmessagemain.py:125:80: E501 line too long (92 > 79 characters) bitmessagemain.py:125:37: E261 at least two spaces before inline comment bitmessagemain.py:128:80: E501 line too long (105 > 79 characters) bitmessagemain.py:128:34: E231 missing whitespace after ',' bitmessagemain.py:128:39: E231 missing whitespace after ',' bitmessagemain.py:128:44: E231 missing whitespace after ',' bitmessagemain.py:128:62: E231 missing whitespace after ',' bitmessagemain.py:131:80: E501 line too long (83 > 79 characters) bitmessagemain.py:135:80: E501 line too long (105 > 79 characters) bitmessagemain.py:135:34: E231 missing whitespace after ',' bitmessagemain.py:135:39: E231 missing whitespace after ',' bitmessagemain.py:135:44: E231 missing whitespace after ',' bitmessagemain.py:135:62: E231 missing whitespace after ',' bitmessagemain.py:142:80: E501 line too long (91 > 79 characters) bitmessagemain.py:144:80: E501 line too long (83 > 79 characters) bitmessagemain.py:145:80: E501 line too long (248 > 79 characters) bitmessagemain.py:145:118: E261 at least two spaces before inline comment bitmessagemain.py:150:80: E501 line too long (142 > 79 characters) bitmessagemain.py:153:80: E501 line too long (115 > 79 characters) bitmessagemain.py:154:80: E501 line too long (108 > 79 characters) bitmessagemain.py:154:64: E231 missing whitespace after ',' bitmessagemain.py:157:80: E501 line too long (107 > 79 characters) bitmessagemain.py:157:98: E203 whitespace before ',' bitmessagemain.py:157:99: E231 missing whitespace after ',' bitmessagemain.py:158:80: E501 line too long (135 > 79 characters) bitmessagemain.py:161:80: E501 line too long (98 > 79 characters) bitmessagemain.py:163:80: E501 line too long (97 > 79 characters) bitmessagemain.py:164:80: E501 line too long (108 > 79 characters) bitmessagemain.py:165:80: E501 line too long (145 > 79 characters) bitmessagemain.py:169:80: E501 line too long (95 > 79 characters) bitmessagemain.py:171:80: E501 line too long (87 > 79 characters) bitmessagemain.py:172:80: E501 line too long (245 > 79 characters) bitmessagemain.py:172:122: E261 at least two spaces before inline comment bitmessagemain.py:177:80: E501 line too long (139 > 79 characters) bitmessagemain.py:180:80: E501 line too long (154 > 79 characters) bitmessagemain.py:183:80: E501 line too long (402 > 79 characters) bitmessagemain.py:184:1: E302 expected 2 blank lines, found 1 bitmessagemain.py:189:5: E303 too many blank lines (2) bitmessagemain.py:190:80: E501 line too long (176 > 79 characters) bitmessagemain.py:191:80: E501 line too long (88 > 79 characters) bitmessagemain.py:197:18: E261 at least two spaces before inline comment bitmessagemain.py:200:80: E501 line too long (87 > 79 characters) bitmessagemain.py:206:9: E303 too many blank lines (2) bitmessagemain.py:207:80: E501 line too long (184 > 79 characters) bitmessagemain.py:208:80: E501 line too long (92 > 79 characters) bitmessagemain.py:212:80: E501 line too long (120 > 79 characters) bitmessagemain.py:215:14: E231 missing whitespace after ',' bitmessagemain.py:215:20: E231 missing whitespace after ',' bitmessagemain.py:217:80: E501 line too long (238 > 79 characters) bitmessagemain.py:220:80: E501 line too long (82 > 79 characters) bitmessagemain.py:223:18: E231 missing whitespace after ',' bitmessagemain.py:223:24: E231 missing whitespace after ',' bitmessagemain.py:226:1: W293 blank line contains whitespace bitmessagemain.py:228:23: E231 missing whitespace after ',' bitmessagemain.py:228:28: E231 missing whitespace after ',' bitmessagemain.py:228:33: E231 missing whitespace after ',' bitmessagemain.py:228:36: E231 missing whitespace after ',' bitmessagemain.py:232:80: E501 line too long (84 > 79 characters) bitmessagemain.py:232:29: E261 at least two spaces before inline comment bitmessagemain.py:233:23: E231 missing whitespace after ',' ``` That's not even the best part of it. You can see the full 2443 line PEP8 error list [here](http://pastebin.com/ixi0sPLa). This shouldn't be so insanely un-pythonic. Some work should be done on cleaning up the source code - maybe some classes, those are helpful.
Wabba commented 2013-05-28 21:09:44 +02:00 (Migrated from github.com)

Pep8 is only a style guide, not a requirement by any means. Personally I think limiting lines to 79 characters is way too short when most people are using larger wide screen monitors these days.

Pep8 is only a style guide, not a requirement by any means. Personally I think limiting lines to 79 characters is way too short when most people are using larger wide screen monitors these days.
sysr-q commented 2013-05-28 23:10:07 +02:00 (Migrated from github.com)

I understand that by no means is it required, but it really contributes a long way to the readability of your code.
Seeing as this is extremely un-pythonic, I don't see why it shouldn't be followed to some extent - I usually ignore E501 (whatever > 79 characters) as well, but in general it's pretty great.

I understand that by no means is it required, but it really contributes a long way to the readability of your code. Seeing as this is extremely un-pythonic, I don't see why it shouldn't be followed to some extent - I usually ignore E501 (whatever > 79 characters) as well, but in general it's pretty great.
sysr-q commented 2013-05-31 03:56:15 +02:00 (Migrated from github.com)

This is still an issue - your main file is unreadable as hell, and has made several Python developers I know want to scoop their eyes out with a spoon.
You should split it up more, clean up your variable names; there's lots you can do to make it a more developer-friendly project.

This is still an issue - your main file is unreadable as hell, and has made several Python developers I know want to scoop their eyes out with a spoon. You should split it up more, clean up your variable names; there's lots you can do to make it a more developer-friendly project.
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Bitmessage/PyBitmessage-2024-12-02#167
No description provided.