Skip to content

Fixed imports and other code#284

Closed
levigross wants to merge 1 commit into
sqlmapproject:masterfrom
levigross:master
Closed

Fixed imports and other code#284
levigross wants to merge 1 commit into
sqlmapproject:masterfrom
levigross:master

Conversation

@levigross

Copy link
Copy Markdown

I cleaned up the import statements and added a few tweaks to the code.

Signed-off-by: Levi Gross <levi@levigross.com>
@stamparm

stamparm commented Dec 5, 2012

Copy link
Copy Markdown
Member

There are good things here, but this is too evasive to be accepted all at once. For example, that import style we use is going to stay as it is. It's easier to us to see what's being imported line by line, and not everything inside one huge line (per used module). Also, you are pushing your code preferences like usage of from re import finditer instead of import re...re.finditer. Breaking of code lines is also a matter of personal preference.

To summarize. Code style preferences not having a strong MUST backed by a PEP will not be merged, at least not like this (in a one huge merge request). Other than that, things like iterkeys and class X(object) are welcome.

@stamparm stamparm closed this Dec 5, 2012
@levigross

Copy link
Copy Markdown
Author

Thanks, can you please write up a quick style guide as to how you expect code to be formatted within pull requests.

@stamparm

stamparm commented Dec 5, 2012

Copy link
Copy Markdown
Member

p.s. do you know any open source project which would merge a request containing changes on 139 files, mostly (personal) style based, coming from a complete stranger?

@stamparm

stamparm commented Dec 5, 2012

Copy link
Copy Markdown
Member

can you please write up a quick style guide as to how you expect code to be formatted within pull requests.

  1. please don't change style on >100 files and expect it to be merged on a main branch
  2. we can discuss about those before doing any "major remake", but be sure that those personal preferences not having a strong support in PEP 8 [1] will be rejected
  3. please make changes on < 5 files per single merge request
  4. style that is too different than in main branch will be "adapted" by our side
  5. non-style related changes are most welcome
  6. don't touch anything inside thirdparty and extra folders (no explanation needed)
  7. please, but please don't do BULK commits/merge requests like this one. Things like thousands of lines of changes "and other code" is highly undesirable in any software project

p.s. nag about style used before doing anything "harsh"

[1] http://www.python.org/dev/peps/pep-0008/

@levigross

Copy link
Copy Markdown
Author

Thanks and sorry for the massive style commit. I have spent a lot of time in the Django world so syntax like from foo import bar1, bar2 is the norm e.g https://github.com/django/django/blob/master/django/contrib/admin/views/main.py#L16.

I think that the above mentioned list should be committed as a guide for contributors (or at least placed in the wiki).

@stamparm

stamparm commented Dec 6, 2012

Copy link
Copy Markdown
Member

We'll do some style guide "compilation", probably "borrowing" some stuff from other projects.

As of that import syntax. If you take a look into PEP 8 you'll see:

It's okay to say this though:

from subprocess import Popen, PIPE

So, basically, as said, it's purely a matter of project-specific preferences

@bdamele

bdamele commented Dec 6, 2012

Copy link
Copy Markdown
Member

@levigross firstly, thanks for your contribution. Although this massive pull request has been closed for the reasons Miroslav highlighted, we appreciate your effort and look forward to your new code contributions. We have just committed https://github.com/sqlmapproject/sqlmap/blob/master/CONTRIBUTING.md to facilitate new code contributions. We have also updated the FAQ page to reflect recent additions to the contributing process, https://github.com/sqlmapproject/sqlmap/wiki/FAQ.

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