quinngroup / dr1dl-pyspark

Dictionary Learning in PySpark
Apache License 2.0
1 stars 1 forks source link

Fix use of spaces between characters and at ends of lines #32

Closed magsol closed 8 years ago

magsol commented 8 years ago

There are many lines in the file that have trailing spaces (extra space characters at the end of a line), as well as spaces between characters that should be deleted (between an opening parenthesis ( and the argument of a function).

For example:

def func( arg1, arg2 ):

has extra spaces between the parentheses and the argument names. The correct version should be:

def func(arg1, arg2):

There should, however, be spaces between operators (such as +, -, *, /, =, and ,).

For example:

print('Analyzing component ',(m+1),'...')

is incorrect, as there are no spaces between the operator + and the operands, or any spaces after the commas. The correct version should be:

print('Analyzing component ', (m + 1), '...')
MOJTABAFA commented 8 years ago

@magsol Actually I tried to apply it in all code, but still in some small parts linter gives the warning, would you please check it and let me know why it's not yet fixed ? Thanks again for reviewing such useful points.

magsol commented 8 years ago

Unfortunately there are more fixes here.

MOJTABAFA commented 8 years ago

Thanks for such valuable pieces of advice. I done it, but just for item 1, when I'm spacing before and after operations ( like type=float ----> type = float) the small boxes around those lines are appeared again in sublime. It seems that the linter again starts to give warning. Again I'm not sure about my IDE and maybe it's a bug in win version of Sublime text 3.

magsol commented 8 years ago

That may correspond to one of the error codes that should be ignored. I posted a ticket with the error codes you should add to the ignore list in the configuration for SublimeLinter. If it's still showing up, I'll double check in case I missed one.

iPhone'd

On Dec 4, 2015, at 15:22, MOJTABAFA notifications@github.com wrote:

Thanks for such valuable pieces of advice. I done it, but just for item 1, when I'm spacing before and after operations ( like type=float ----> type = float) the small boxes around those line are appeared again in sublime. It seems that the linter again starts to give warning. Again I'm not sure about my IDE and maybe it's a bug in win version of Sublime text 3.

— Reply to this email directly or view it on GitHub.

magsol commented 8 years ago

A couple more small fixes:

MOJTABAFA commented 8 years ago

Thanks and sorry about forgetting that two modifications . those are applied now !

magsol commented 8 years ago

Another few:

MOJTABAFA commented 8 years ago

It's applied , Thanks!

magsol commented 8 years ago

Small edits:

Larger edits:

MOJTABAFA commented 8 years ago

Thanks , the modifications have been applied on code.

magsol commented 8 years ago

A few more:

MOJTABAFA commented 8 years ago

applied. thanks.

magsol commented 8 years ago
MOJTABAFA commented 8 years ago

As I remember , previously you told me that between "parameters and previous line should be a space" ( 3 posts earlier in the current issue) so lines 9, 17 and 32 should be remained ?

magsol commented 8 years ago

They should be blank lines, yes. My point is that they should not have any trailing whitespace.

What I mean by that: somehow, on those three lines, you didn't type anything, but you did hit the spacebar a few times before hitting "enter". Thus, the line is blank (no text), but there are trailing spaces. These need to be deleted.

They should show up in your Sublime editor. It should look like this:

screen shot 2015-12-08 at 4 58 35 pm
magsol commented 8 years ago

There should be blank lines, but there should NOT be trailing whitespace.

MOJTABAFA commented 8 years ago

Ok, Thanks got it now.