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

Linting and cleaning #1145

Closed
wants to merge 1 commit into from
Closed

Linting and cleaning #1145

wants to merge 1 commit into from

Conversation

jcrowgey
Copy link

@jcrowgey jcrowgey commented Feb 9, 2018

Linted with flake8, ignoring a handful of items which seemed to be less
crucial F403,E266,F401,E402,F405

I was inspired to do this work because of all of the hanging whitespace.
When I saw the contributor docs are looking to move to PEP8, I wanted to
contribute some effort to clean up the codebase.

If this work is appreciated and merged, I'll move into the
subdirectories as I have time.

I created a corresponding issue: #1144

Linted with flake8, ignoring a handful of items which seemed to be less
crucial F403,E266,F401,E402,F405

I was inspired to do this work because of all of the hanging whitespace.
When I saw the contributor docs are looking to move to PEP8, I wanted to
contribute some effort to clean up the codebase.

If this work is appreciated and merged, I'll move into the
subdirectories as I have time.
@codecov-io
Copy link

codecov-io commented Feb 9, 2018

Codecov Report

Merging #1145 into master will decrease coverage by 0.04%.
The diff coverage is 79.02%.

@@            Coverage Diff             @@
##           master    #1145      +/-   ##
==========================================
- Coverage   83.51%   83.47%   -0.05%     
==========================================
  Files         157      157              
  Lines       37818    37816       -2     
==========================================
- Hits        31585    31568      -17     
- Misses       6233     6248      +15
Impacted Files Coverage Δ
scapy/consts.py 81.81% <ø> (ø) ⬆️
scapy/compat.py 89.74% <0%> (ø) ⬆️
scapy/autorun.py 83.33% <100%> (ø) ⬆️
scapy/asn1packet.py 94.73% <100%> (ø) ⬆️
scapy/utils6.py 87.75% <100%> (ø) ⬆️
scapy/dadict.py 98.71% <100%> (ø) ⬆️
scapy/pton_ntop.py 97.26% <100%> (ø) ⬆️
scapy/error.py 90.19% <100%> (ø) ⬆️
scapy/volatile.py 79.44% <57.84%> (-0.04%) ⬇️
scapy/supersocket.py 79.22% <63.63%> (ø) ⬆️
... and 24 more

@gpotter2
Copy link
Member

gpotter2 commented Feb 9, 2018

Hi !
Unfortunatly, this is very unlikely to get accepted. We're keeping the codebase clean so that we can use the history properly.

@jcrowgey
Copy link
Author

jcrowgey commented Feb 9, 2018

The codecov is a little spurious, the - 0.05 coverage delta is most likely due to a denominator increase where I added the newlines that PEP8 requires between top-level def and class blocks. I can look into hacking that metric (I dunno, add some very simple test somewhere), but tbh I didn't get the tests working on linux, seems like they're commented out in the tox.ini.

Let me know if I should worry about this.

@p-l-
Copy link
Member

p-l- commented Feb 11, 2018

As explained by @gpotter2 and in CONTRIBUTING, we try to keep the code history as possible. Sorry about that.

@p-l- p-l- closed this Feb 11, 2018
@jcrowgey
Copy link
Author

jcrowgey commented Feb 11, 2018

@p-l- Sorry, I'm quite confused.

The robot says you're trying to keep the codebase clean. I've cleaned this code. It's now more clean. You say "we try to keep the code as history as possible". I'm having a parse failure on that sentence.

I had a lot of difficulty reading scapy source code because of all of the trailing whitespace and inconsistencies in style. Your CONTRIBUTING guides says you're pushing for PEP8. What am I missing?

Cheers!

@gpotter2
Copy link
Member

@jcrowgey He surely meant « as clean as possible ».

We know that there are tons of non Pep8 files in the code. If you read arch/pcapdet.py for instance, the file is absolute madness.

But if we pepify all the code, any ˋgit blame` we will do will point to the pepify commit, which would make debugging much harder...

@p-l-
Copy link
Member

p-l- commented Feb 11, 2018

Lol @gpotter2 is not a robot (or are you, @gpotter2? That would explain how hard you can work)!

I'm really sorry if you have troubles reading Scapy source code because of trailing whitespaces, but we won't break the code history for that. When working on Scapy I really often use git log -p [that file] or git bissect, and such pull requests would make it much harder.

Also, if you read CONTRIBUTING, you'll see that the PEP-8 compliance statement applies to new code.

BTW, maybe next time, before writing your pull request, you could open an issue to tell us you're working on something (that's also suggested in CONTRIBUTING). This would allow us to discuss before you do an important work and avoid the frustration (that I totally understand; again, I'm sorry).

@guedou
Copy link
Member

guedou commented Feb 11, 2018 via email

@jcrowgey
Copy link
Author

Thanks, everyone for the fuller explanation. Sorry you guys aren't in a state where you can accept this work.

Sorry, @gpotter2, for dehumanizing you. Your prompt response and what seemed (from my point of view) to be a somewhat non-sequitur reply made me assume that I was looking at an automated message gone wrong.

@karpierz
Copy link
Contributor

:: Lol @gpotter2 is not a robot
Cannot agree ! @gpotter2 is a robot because he/it never sleeps! ;)

@gpotter2
Copy link
Member

gpotter2 commented Feb 12, 2018 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.

6 participants