Skip to content
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

Make code base compliant with PEP-8 E-261. #5144

Closed
wants to merge 9 commits into from

Conversation

adnrs96
Copy link
Member

@adnrs96 adnrs96 commented May 31, 2017

This PR will track the commits which will eventually lead our code base to 100% compliance with the PEP-8 E-261. According to E-261 two spaces must be used before making an inline comment.
This contains changes which might cause merge conflicts but won't require manual intervention while rebasing. Automerge can deal with them. Also after this some 26 files are left before we can enable this check in linters.

@smarx
Copy link

smarx commented May 31, 2017

Automated message from Dropbox CLA bot

@adnrs96, it looks like you've already signed the Dropbox CLA. Thanks!

@timabbott
Copy link
Member

Merged, thanks @adnrs96! Leaving this open so you can add more commits.

What are the PRs conflicting with the big files left (e.g. models.py)? It might make sense to just convert those and suffer a few conflicts.

@adnrs96
Copy link
Member Author

adnrs96 commented Jun 1, 2017

'zerver/tests/test_auth_backends.py PR#4286(+82-47)',
'zerver/tornado/event_queue.py PR#4110(+2-1)',
'zerver/tornado/socket.py PR#3202(+55-13)',
'zerver/tornado/websocket_client.py PR#3202(+49-54)',
'zerver/webhooks/hellosign/view.py PR#4472(+6-8)',
'zproject/backends.py PR#4286(+49-6)',
'tools/run-dev.py PR#4286(+16-0) PR#4880(+1-1) PR#4973(+11-4)',
'zerver/decorator.py PR#4822(+2-2) PR#4837(+2-2)',
'zerver/lib/bugdown/init.py PR#4110(+2-1) PR#4132(+5-2) PR#2167(+9-1) PR#2200(+18-1) PR#4918(+1-1) PR#2248(+1-1) PR#2170(+20-4) PR#3923(+5-7) PR#4973(+16-2) PR#1393(+9-0) PR#1935(+2-1)',
'zerver/models.py PR#4110(+4-4) PR#3667(+49-0) PR#1122(+36-0) PR#4722(+6-0) PR#1179(+14-8) PR#4918(+5-3) PR#3317(+7-0) PR#1289(+40-8) PR#1325(+42-0) PR#3382(+2-0) PR#1339(+20-0) PR#850(+1-0) PR#4451(+36-0) PR#1393(+16-0) PR#1432(+3-0) PR#2997(+1-0) PR#5057(+11-1)',
'zerver/tests/test_bugdown.py PR#4110(+20-0) PR#4132(+1-1) PR#4918(+13-0) PR#2170(+11-0) PR#3923(+2-2) PR#4973(+34-0) PR#1393(+20-0) PR#2450(+15-0)',
'zerver/tests/test_events.py PR#4162(+97-79) PR#4722(+2-3) PR#4918(+1-1) PR#3382(+1-0) PR#4926(+75-15) PR#5023(+55-25) PR#4065(+67-0)',
'zerver/tests/test_messages.py PR#4110(+40-0) PR#4635(+10-14) PR#1289(+97-49) PR#3346(+20-20) PR#1325(+38-2) PR#1339(+38-2)',
'zerver/tests/test_narrow.py PR#4279(+39-0) PR#1289(+39-19) PR#3367(+4-4) PR#3051(+74-0)',
'zerver/tests/test_realm.py PR#4156(+21-0) PR#3382(+1-0) PR#4586(+5-3)',
'zerver/tests/test_signup.py PR#1747(+78-7) PR#3367(+2-2) PR#4393(+8-4)',
'zerver/tests/test_subs.py PR#1122(+17-1) PR#4722(+5-5) PR#1747(+2-2) PR#749(+37-1) PR#3367(+2-2) PR#2984(+6-0)',
'zerver/tests/test_unread.py PR#1289(+7-2)',
'zerver/tests/test_upload.py PR#3706(+15-9) PR#4387(+18-1) PR#4973(+32-0)',
'zerver/worker/queue_processors.py PR#3667(+28-0) PR#3367(+1-1) PR#1393(+21-0) PR#5057(+5-8)',
'zilencer/management/commands/populate_db.py PR#1122(+7-5) PR#4946(+18-7)',
'zproject/dev_settings.py PR#1747(+3-0) PR#4387(+3-0)',
'zproject/prod_settings_template.py PR#4387(+6-7) PR#4973(+4-0)',
'zproject/settings.py PR#5127(+1-0) PR#2172(+1-0) PR#4767(+1-0) PR#4305(+10-2) PR#1747(+13-0) PR#4822(+1-1) PR#4387(+11-0) PR#3367(+6-3) PR#3397(+10-0) PR#2379(+1-0) PR#4973(+3-0) PR#4986(+3-0) PR#388(+1-0) PR#3227(+4-4) PR#5059(+0-23) PR#5070(+0-10) PR#4607(+1-0)',

These are the totality of the remaining files which needs to be cleaned. All of these will be causing merge conflicts to any on of the associated PR. I now feel that I could have augmented the scanning tool to tell exactly with with PR is the conflict going to occur. I guess we should do a second round with files which will cause conflicts to PR's (But PR's are small enough to rebase manually without much effort. eg 'zproject/dev_settings.py PR#1747(+3-0) PR#4387(+3-0)).

@timabbott timabbott mentioned this pull request Jun 2, 2017
@timabbott
Copy link
Member

I think some of the conflicts PRs are now cleaned up / closed. I think you can definitely proceed with zerver/tornado/event_queue.py; that conflict is small and the file is big.

I think we should be able to clear out several more of the PRs that conflict here in the next week or so.

#3367 and #1747 already have a lot of conflicts and we can ignore for this purpose.

@adnrs96
Copy link
Member Author

adnrs96 commented Jun 4, 2017

@timabbott Did some more clean up. Still there are around 20 of files from that list pending.
I have added the last commit which is focused on enabling the linter to check for pep-E261 violations by default with an ignore list of those 20 files. This should ensure no new violations to this rule could get onto master. (Observed some new violations being added recently).

@adnrs96 adnrs96 force-pushed the pep-8-E261 branch 2 times, most recently from 3054847 to 99edb94 Compare June 4, 2017 11:22
@timabbott
Copy link
Member

Great, merged! I think shortly after 1.6 we'll be able to merge several of the conflicting PRs.

@zulipbot
Copy link
Member

zulipbot commented Jun 5, 2017

Heads up @adnrs96, we just merged some commits (latest: 5fe7ed8) that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@adnrs96
Copy link
Member Author

adnrs96 commented Jul 9, 2017

None of these are merge conflict free, I tried to order them as models.py, bugdown/__init__.py and then files which I felt had minimum number of changes. I haven't pushed all the files (I can do that I wanted but all of them will cause merge conflicts). Files for which commits are not there currently in this PR

'zerver/tests/test_bugdown.py',
        'zerver/tests/test_events.py',
        'zerver/tests/test_messages.py',
        'zerver/tests/test_narrow.py',
        'zerver/tests/test_realm.py',
        'zerver/tests/test_signup.py',
        'zerver/tests/test_subs.py',
        'zerver/tests/test_upload.py',

Will post the conflict report after this in separate message.

(My theory for low number of changes was that conflicts would probably be easy to solve if we end up merging them)

@adnrs96
Copy link
Member Author

adnrs96 commented Jul 9, 2017

tools/run-dev.py PR#5224(+6-6) PR#4880(+1-1) PR#4973(+11-4)
zerver/lib/bugdown/init.py PR#5633(+19-5) PR#4110(+2-1) PR#4132(+5-2) PR#2167(+9-1) PR#5253(+27-0) PR#2200(+18-1) PR#2248(+1-1) PR#2170(+20-4) PR#3923(+5-7) PR#4973(+16-2) PR#1935(+2-1) PR#5521(+1-0) PR#5594(+30-11)
zerver/models.py PR#5633(+25-0) PR#4110(+4-4) PR#5649(+7-1) PR#5658(+19-9) PR#5665(+3-0) PR#5723(+1-0) PR#5720(+2-2) PR#1122(+36-0) PR#5224(+2-3) PR#5141(+12-2) PR#1179(+14-8) PR#3317(+7-0) PR#5367(+2-0) PR#1325(+42-0) PR#5341(+3-0) PR#3382(+2-0) PR#1339(+20-0) PR#4451(+36-0) PR#5525(+14-0) PR#1432(+3-0) PR#5573(+2-0) PR#850(+1-0)
zerver/tests/test_bugdown.py PR#5633(+33-0) PR#4110(+20-0) PR#4132(+1-1) PR#2170(+11-0) PR#3923(+2-2) PR#4973(+34-0) PR#5594(+8-0)
zerver/tests/test_events.py PR#5669(+2-0) PR#4162(+97-79) PR#5240(+84-2) PR#5367(+2-0) PR#3382(+1-0) PR#5023(+55-25) PR#5573(+1-0) PR#4065(+67-0)
zerver/tests/test_messages.py PR#5633(+1-1) PR#4110(+40-0) PR#3346(+20-20) PR#1325(+38-2) PR#1339(+38-2)
zerver/tests/test_narrow.py PR#3367(+4-4) PR#3051(+74-0)
zerver/tests/test_realm.py PR#5658(+4-4) PR#5367(+1-0) PR#3382(+1-0) PR#4586(+7-5)
zerver/tests/test_signup.py PR#5633(+1-1) PR#5656(+2-2) PR#5658(+7-12) PR#5720(+2-2) PR#1747(+78-7) PR#4393(+12-0) PR#5532(+0-4)
zerver/tests/test_subs.py PR#5633(+3-3) PR#1122(+17-1) PR#1747(+2-2) PR#749(+37-1) PR#3367(+1-1) PR#2984(+7-1)
zerver/tests/test_upload.py PR#3706(+15-9) PR#4387(+18-1) PR#4973(+32-0)
zerver/tornado/socket.py PR#3202(+55-13)
zerver/tornado/websocket_client.py PR#3202(+49-54)
zerver/worker/queue_processors.py PR#5633(+9-0) PR#5649(+1-0) PR#5720(+2-2) PR#3367(+1-1) PR#5422(+4-1)
zilencer/management/commands/populate_db.py PR#5633(+6-0) PR#1122(+7-5) PR#4946(+18-7) PR#5525(+14-0)
zproject/dev_settings.py PR#1747(+3-0) PR#4387(+3-0)
zproject/prod_settings_template.py PR#5224(+0-8) PR#4387(+6-7) PR#4973(+4-0)
zproject/settings.py PR#5669(+2-0) PR#5720(+2-1) PR#5224(+2-3) PR#2172(+1-0) PR#4767(+1-0) PR#5300(+1-0) PR#5445(+0-5) PR#4305(+10-2) PR#1747(+13-0) PR#5345(+1-0) PR#4387(+11-0) PR#3367(+6-3) PR#4393(+5-1) PR#5239(+1-0) PR#3397(+10-0) PR#4973(+3-0) PR#4986(+3-0) PR#388(+1-0) PR#3227(+2-1)

@adnrs96
Copy link
Member Author

adnrs96 commented Jul 9, 2017

@timabbott Please take a look.
(Sorry for the super delay on this)

@timabbott
Copy link
Member

I looked through these, and they all seemed pretty low-risk except models.py and bugdown, which I think we just need to merge at this point. Merged, thanks @adnrs96!

Looking at the remaining changes, to test files, I think it's probably safe to push those through. The PRs they'll conflict with all basically just add new tests, so there's unlikely to be interesting merge conflicts.

So I think we can finish this off!

@adnrs96
Copy link
Member Author

adnrs96 commented Jul 11, 2017

Sure, I will update the PR.

@zulipbot
Copy link
Member

Heads up @adnrs96, we just merged some commits that conflict with the changes your made in this pull request! You can review this repository's recent commits to see where the conflicts occur. Please rebase your feature branch against the upstream/master branch and resolve your pull request's merge conflicts accordingly.

@adnrs96
Copy link
Member Author

adnrs96 commented Jul 11, 2017

@timabbott Just updated this. After this pep8 E261 migrations will come to an end 🎉

@adnrs96
Copy link
Member Author

adnrs96 commented Jul 11, 2017

hmm, I left out a glitch earlier and that's why the tests failed but fixed it.
Probably shouldn't be a problem now

@timabbott
Copy link
Member

Merged, thanks @adnrs96! It's awesome to have this big migration complete :)

@timabbott timabbott closed this Jul 11, 2017
@adnrs96 adnrs96 deleted the pep-8-E261 branch July 11, 2017 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants