upcoming / upcoming-www

Upcoming.org Site
Apache License 2.0
168 stars 15 forks source link

Basic PEP8 conformance now added and testable #2

Closed snark closed 9 years ago

snark commented 9 years ago

PEP8 is the Python code format standard; I've written a unittest-style test for everything in the code directories (you can run it with a simple "python tests/test_pep8" or the more elaborate run-everything "python -m unittest discover tests/"). I've further gone through and cleaned everything up so that it conforms to this standard; the heavy lifting was done with the autopep8 tool, which I have not included in the requirements-dev list but which may be useful for getting future changes to conform.

If the key devs on this (hi Leonard! hi Andy!) want to relax some of the PEP8 strictures, such as the 80-character limit on line length, we can add a pep8 config file.

lhl commented 9 years ago

@snark thx for the work. how relaxed can we go on pep8 tests? specific things:

snark commented 9 years ago

Looking this up: 2-space formatting is E114; triple # in block comments is E266; I think the import stuff is E401. Let me strongly encourage you to add a style guide note if you're wedded to 2-space indents, since 4-space is a very strong preference in the wider Python ecosystem, and contributors aren't going to be doing it.

Want me to add config to disable those checks and resubmit the pull rec?

lhl commented 9 years ago

Hey @snark sorry for losing track of this, last week got crazy. Mind disabling the checks as we talked about and resubmitting? I'll make a task to have a styleguide about 2-space indents.