Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Autopep8 style whitespace cleanups & pre-commit hook#173

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:masterfromcraigez:feature/pep8
Jul 25, 2014

Conversation

craigez
Copy link
Contributor

I've got a couple bug fixes I'm keen to commit, but I was wondering if you would accept a PR for a pep8 update as the trailing whitespace, etc... makes it a pain when your environment is set up to eliminate such things. If not I'll just start submitting the small fixes with your current formatting.

I also added a really basic pre-commit hook to check pep8 style, wasn't sure how you would want it installed. Only place I could see for now was doing it in setup.py.

@Byron
Copy link
Member

Thanks for the contribution, a massive one indeed.
Something I don't like about it is the changes to the line length. Internally, I work with 120 characters, which is enough to fit two buffers side by side on a full-HD screen at a moderate font size. For some reason I am unwilling to keep code readable for those still working on aVT 100 ;).

Something I am particularly concerned about is the modifications tosetup.py. Won't they break any windows installation ? Git-python traditionally ran on this unholy platform, and I wouldn't want to break installation for those users.
Also, pre-commit.sh usespep8 without checking if it is actually installed (or in the PATH),which will fail ungracefully whenever it isn't. For now, I would want to consider integrating this tool optional, which shouldn't fail if it's not available.

@craigez
Copy link
ContributorAuthor

I can re-do it without the line length alterations, no worries. I just ran autopep8. :)

As for windows, the shell script will break that too. :) Maybe we need something more complex then. Let me think about that.

I would suggest against considering pep8 optional. Either standardize on pep8, fix all the issues and add a pre-commit hook to keep it that way. Or don't worry about it at all. I'm not sure there's much value in fixing a coding standard but not enforcing it.

Seems this'll need a little more work, so I'll submit the other fixes I have separately while this is discussed & modified. Thanks for the feedback.

@Byron
Copy link
Member

If I were you, I wouldn't spend any time to enforce automation of pep8, as you cannot possibly make it run or enforce it anywhere.
The way I think this can be done is to setup contribution guidelines which specify how code should be formatted, thusencouraging it using social means. One could, for instance, suggest tools or plugins that help doing this automatically, likethis one.

In the end, such contribution guidelines should include a rule stating that prior to making a new release, pep8 needs to be run on all source files. That way, contributions can be made more easily, and the overall workflow will be faster, as the maintainer still can use github auto-merge.

As you can see, many things you, and I, run into now should be should be specified somewhere in the project. In general, I would like to align withthis spec, sometime in the future.

@hashar
Copy link
Contributor

You can use tox to provide an easy way for developers to run pep8 with a specific version of pep8 and custom rules. That can then be added in Travis-ci to automatically test pull requests.

I highly recommend using flake8 which is a wrapper around both pep8 and pyflakes (the later catching other issues) and also provides its own checks.

As for 80 versus 120 characters lines. I do all my coding in 80 columns terminal :-D

@craigez
Copy link
ContributorAuthor

I changed this branch to just be the whitespace changes with a max line length of 120.

@Byron
Copy link
Member

Thank you ! In order to assure your valuable hints will not be lost in a closed pull request, I am cross-referencing it inthis issue.

That way, the required changes can be made at some point.

Argh, it seems a previous merge is now causing conflicts, preventing an automatic merge. I shall have a look some time later today.

@craigez
Copy link
ContributorAuthor

I can rebase it later if I get a chance.

@Byron
Copy link
Member

Great, thanks !

@craigez
Copy link
ContributorAuthor

Done, rebased.

@Byron
Copy link
Member

Thanks very much for your help. I am quite busy withanother project right now.

Byron added a commit that referenced this pull requestJul 25, 2014
Autopep8 style whitespace cleanups & pre-commit hook
@ByronByron merged commita66cfe9 intogitpython-developers:masterJul 25, 2014
@hashar
Copy link
Contributor

Would you mind applying autopep8 (with the same settings) on the 0.3 branch as well?

I have proposed a patch on branch 0.3 to bring tox + flake8 to easily check the repo is compliant (PR#179 ).

@craigez
Copy link
ContributorAuthor

No worries, I submitted PR#182 which is autopep8 with max length of 120 run against 0.3 branch.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@craigez@Byron@hashar

[8]ページ先頭

©2009-2025 Movatter.jp