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

pep8_fixes #116

Merged
merged 4 commits into from
Dec 1, 2016
Merged

pep8_fixes #116

merged 4 commits into from
Dec 1, 2016

Conversation

the-zebulan
Copy link
Contributor

@the-zebulan the-zebulan commented Nov 29, 2016

I fixed the PEP8 issues in all of the files in py_src except:

  • chord.py (as discussed in the previous PR)
  • a single line in py_src/test_utils.py. I'm sure it could be split up like the other strings but with the various punctuation in the string I didn't want to mess up the command for the windows batch file (and I don't have a Windows computer to test the command).

I've been pushing these commits to my fork and checking the results on CodeClimate. Currently, the score is up to 3.0 GPA from 2.81 GPA.

Let me know what you think!

@LivInTheLookingGlass
Copy link
Collaborator

I'll take a look in the morning. Git diff isn't telling me anything useful, because it thinks you rewrote the whole file. So I'll have to be awake for this (oh no!)

The couple changes I did notice look good so far though. It's kind of hilarious that even after fixing 200+ issues, base.py still has >100 flagged. I really messed up XD

@LivInTheLookingGlass
Copy link
Collaborator

From what I saw this almost certainly gets merged. I'll want to try and fix some Javascript style stuff as well, just to merge all of it at once, but that's on my head.

@LivInTheLookingGlass
Copy link
Collaborator

To make sure though, you're:

  1. Okay being listed in the authors section, and
  2. Okay with it being licensed under me still, just in case I need to change the license at some point

Dolphin-emu had a really bad time with that last part, so I'd like to get ahead of it before it inevitably needs to happen.

@the-zebulan
Copy link
Contributor Author

the-zebulan commented Nov 29, 2016

Git diff isn't telling me anything useful, because it thinks you rewrote the whole file

I just looked at the diff now and realized what I did, it was the line-endings that were changed (I only really changed the PEP8 issue parts). I think the original files were using CRLF and when I loaded them in PyCharm it replaces them with LF (my default settings on Ubuntu). When I went to commit, I noticed it said I was using CRLF and I didn't realize why so I changed them back. I think PyCharm was trying to do the right thing by converting them back when I committed them but I overrode it without thinking about it (late night coding, my mistake). I can change the line-endings back to CRLF if you want?

Okay being listed in the authors section

If you think that's appropriate, sure. I didn't really add much to the project so I'm ok if you don't want to list me there. I'm just trying to get more practice using git and GitHub so I win either way!

Okay with it being licensed under me still, just in case I need to change the license at some point

No problem at all, I don't want to cause any issues with the licence because of my style commits!

@the-zebulan
Copy link
Contributor Author

the-zebulan commented Nov 29, 2016

The couple changes I did notice look good so far though. It's kind of hilarious that even after fixing 200+ issues, base.py still has >100 flagged. I really messed up XD

I'm not sure you are correct there, I think base.py only has one issue left (the complexity one). I could be wrong but... it seems like the CodeClimate for my fork of your repo is only showing the develop branch but the changes I made were to a new branch, pep8_fixes.

https://codeclimate.com/github/the-zebulan/p2p-project/py_src/base.py

It shows 114 issues but 113 are PEP8 style issues which I fixed in the pep8_fixes branch.

If I understand CodeClimate correctly (this is my first time using it so I could be wrong!), I think most of the Python files style issues are fixed. So, I don't think you messed up too bad!

@the-zebulan
Copy link
Contributor Author

the-zebulan commented Nov 29, 2016

I just went through the files in the py_src directory on the develop branch to see what the original line-endings were for each file.

Filename CRLF LF
test/__init__.py ☑️
test/test_base.py ☑️
test/test_cbase.py ☑️
test/test_chord.py ☑️
test/test_mesh.py ☑️
test/test_sync.py ☑️
test/test_utils.py ☑️
__init__.py ☑️
base.py ☑️
chord.py ☑️
kademlia.py ☑️
mesh.py ☑️
ssl_wrapper.py ☑️
sync.py ☑️
utils.py ☑️

In my PR, all of the files (except two) now have the line-endings set as LF. The two files that still have CRLF are:

  • test/__init__.py (because I didn't modify it)
  • chord.py (because you didn't want it modified, at least yet).

Since the line-endings don't seem to be consistent across the files in py_src, I'm not sure how to handle this particular issue.

  • I could make them match the original file line-endings so the git diffs are much easier for you to see which changes I made. Then you could always change them afterwards to whatever line-ending you prefer.
  • I could leave them all as LF (and even convert the line-endings in test/__init__.py and chord.py) for consistency.
  • I could set them all to CRLF for consistency (maybe you use Windows to develop or just have CRLF set as your preferred line-ending?)

Let me know if you think I should make any modifications to this PR!

@LivInTheLookingGlass
Copy link
Collaborator

it seems like the CodeClimate for my fork of your repo is only showing the develop branch but the changes I made were to a new branch, pep8_fixes.

Yeah, I ran into that bug before. Should have thought of that before I sounded silly.

I can change the line-endings back to CRLF if you want?

At some point I had Sublime (or maybe git) translating these to CRLF for me, but I've had to reimage my computers a few times since then. Probably this is where the inconsistencies occurred. If you changed that back to CRLF I'd say thank you. I occasionally need to work on Windows (yuck), so it's nice for it to be consistently that way.

@LivInTheLookingGlass
Copy link
Collaborator

Also, feel free to ignore the red light from Travis on the most recent test. It looks like cryptography installed wrong.

@the-zebulan
Copy link
Contributor Author

Ok, quick question. Since some of the files had LF to begin with, if I change them back to CRLF then the git diff will be harder for you to read on those ones as well. Two ideas...

  • I could make them match the develop branches original line-endings temporarily so that you could see/approve the changes I made. Then I could set them all to CRLF as you prefer before merging.
  • Or, I could just switch every file in py_src to have CRLF line-endings. I have no problem doing this at all, I just don't want to cause you extra work in reading through the git diffs where it looks like the whole file has changed.

What do you think?

@LivInTheLookingGlass
Copy link
Collaborator

Just switch it all. I can deal with it on my end fairly easily.

@the-zebulan
Copy link
Contributor Author

Ok, I'm on it.

@the-zebulan
Copy link
Contributor Author

the-zebulan commented Nov 29, 2016

Looks like py_src/README.rst also has LF, should I switch that one too or just do the .py files?

@codecov-io
Copy link

Current coverage is 71.65% (diff: 85.47%)

Merging #116 into develop will increase coverage by 0.07%

@@            develop       #116   diff @@
==========================================
  Files            15         15          
  Lines          1492       1496     +4   
  Methods           0          0          
  Messages          0          0          
  Branches        240        241     +1   
==========================================
+ Hits           1068       1072     +4   
- Misses          390        391     +1   
+ Partials         34         33     -1   

Powered by Codecov. Last update 0dc2cbe...ad6a3d8

@LivInTheLookingGlass
Copy link
Collaborator

Might as well leave the text files alone. I only really want to focus on the Python stuff for the moment.

@the-zebulan
Copy link
Contributor Author

That last commit I pushed changed the line-endings in all of the Python files in py_src to CRLF. I did not touch the README.rst.

@LivInTheLookingGlass LivInTheLookingGlass merged commit ae78e42 into p2p-today:develop Dec 1, 2016
@LivInTheLookingGlass
Copy link
Collaborator

You're now merged. I'm going to make a quick update to the author section. Would you prefer your GitHub handle, or a name?

@the-zebulan
Copy link
Contributor Author

Awesome! I'm glad you approved of the changes. Also, I'm fine with you just using my GitHub username for the author section.

Thanks again for your time and the merge!

@the-zebulan the-zebulan deleted the pep8_fixes branch December 1, 2016 06:27
@LivInTheLookingGlass
Copy link
Collaborator

No problem. I'd love it if you stuck around and helped more, not that I would demand it. There's a lot of code which could probably be cleaned up, and I'm going to have to work full time on chord.py if I want to make my release schedule.

@the-zebulan
Copy link
Contributor Author

The only issue is that I don't have a lot of experience with any other language than Python (a little bit of JavaScript too, I guess) and I haven't really worked on any big projects yet either.

I'm still learning about programming in general so I don't know if I'd be much help (your code seems fairly advanced compared to anything I usually write!).

@LivInTheLookingGlass
Copy link
Collaborator

Would it help if I gave a specific goal?

As for the other languages, feel free to leave that to me. ON some of them I don't know much of what I'm doing either. Golang especially.

@the-zebulan
Copy link
Contributor Author

Ya, if you could point me in the right direction I could try and work towards goals. I'm trying to gain programming experience so any opportunity to practice/learn seems like a good idea to me!

@LivInTheLookingGlass
Copy link
Collaborator

LivInTheLookingGlass commented Dec 1, 2016 via email

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.

3 participants