Skip to content

PEP8 cleanup (without functional code changes) #406

Closed

Description

@peterjc

Tracking issue for applying small PEP8 changes like white space which do NOT alter the code behaviour, and discussion of dividing labour to avoid stepping on each other's toes. i.e. You can comment here if you are planning to work on a batch of modules.

Ideally this will allow us to routinely use a git pre-commit hook like https://github.com/cbrueffer/pep8-git-hook as outlined on the mailing list thread, http://mailman.open-bio.org/pipermail/biopython-dev/2014-October/020741.html

CC @carlosp420 and @twrightsman

Activity

  1. carlosp420 commented on Nov 19, 2014

    @carlosp420
    Contributor

    I think almost all PEP8 fixes in base code and tests are completed by now. Although there might be very few style errors that managed to remain unnoticed.
    Note that the pre-commit hook is ignoring many errors that will be triggered by PEP8 tools.

  2. twrightsman commented on Nov 19, 2014

    @twrightsman

    The pre-commit hook has some PEP8 options turned off, so the same results should be achieved with the PEP8 tools as long as we choose the same options, right?

  3. cbrueffer commented on Nov 19, 2014

    @cbrueffer
    Member

    Exactly, the commit hook uses the pep8 tool internally. Great work on the PEP8 fixes everyone, nice to see so much progress!

    I think any classes that have been fixed throughout the repository and that are currently disabled in the hook should be enabled, so things don't deteriorate.

    Do such classes exist?

    Cheers,

    Chris

  4. carlosp420 commented on Nov 20, 2014

    @carlosp420
    Contributor

    It would need to be checked if any of the ignored error codes in the hook can be removed. My guess is that it would be necessary another pass through the base code to fix any PEP8 error class before removing it from the hook.

  5. peterjc commented on Jan 5, 2015

    @peterjc
    MemberAuthor

    Having been using the commit hook on (some of) my own machines, there are still plenty of (harmless) white space issues in the code base which do not follow PEP8, e.g. spaces around mathematical operators. I've been fixing this as an when I happen to touch a file for another reason.

  6. carlosp420 commented on Jan 5, 2015

    @carlosp420
    Contributor

    I included these exceptions in my pre-commit hook:

    E261 at least two spaces before inline comment
    E225 missing whitespace around operator
    E226 missing whitespace around arithmetic operator
    E227 missing whitespace around bitwise or shift operator
    E228 missing whitespace around modulo operator

    as suggested here
    http://mailman.open-bio.org/pipermail/biopython-dev/2014-October/020748.html

    Maybe those are the spaces that you keep finding?

    On Mon, Jan 5, 2015 at 1:18 PM, Peter Cock [email protected] wrote:

    Having been using the commit hook on (some of) my own machines, there are
    still plenty of (harmless) white space issues in the code base which do not
    follow PEP8, e.g. spaces around mathematical operators. I've been fixing
    this as an when I happen to touch a file for another reason.

    —
    Reply to this email directly or view it on GitHub
    #406 (comment).

  7. peterjc commented on Jan 6, 2015

    @peterjc
    MemberAuthor

    Yes, and in general I found following these makes the code a little bit clearer - although for some of the more complex mathematical formulas it can be useful to omit the spaces around multiplication, to emphasise visually that happens before any addition/subtraction.

  8. peterjc commented on Mar 25, 2015

    @peterjc
    MemberAuthor

    I'm going to mark this as closed, and focus next on adopting the pre-commit git hook, new issue #493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions