bugranger - Bugs: bug #36009, PEP-8

 
 

bug #36009: PEP-8

Submitted by:  Mantas <sirex>
Submitted on:  Mon 26 Mar 2012 07:51:02 PM UTC  
 
Severity: 3 - NormalStatus: Fixed
Privacy: PublicAssigned to: None
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sun 10 Feb 2013 02:45:32 AM UTC, comment #5:

I replaced tabs with spaces in ranger-master now. Sorry for the wait.

Roman Z. <hut>
Project Administrator
Fri 24 Aug 2012 07:43:25 PM UTC, comment #4:

Attached a patch, where all tabs ar changed to spaces, using this command:

find -iname '*.py' | while read f ; do expand -it 4 $f > $f.bak && mv $f.bak $f ; done

(file #26423)

Mantas <sirex>
Tue 27 Mar 2012 03:23:02 PM UTC, comment #3:

This is convincing enough. I'll change tabs to spaces when I'm done with rifle.

Roman Z. <hut>
Project Administrator
Tue 27 Mar 2012 07:22:24 AM UTC, comment #2:

Each change covers other changes all the time, and this does not mess with git, if you want to dig deeper, you just need to specify revision, to uncover earlier changes.

Of course in this case, many lines will be changed and probably you will need to specify revision with git blame more often (and this adds some inconvenience), but sooner it will be re-factored, sooner it will be covered by new changes and such inconvenience simply disappears.

By the way (I'm mercurial user), but found in git-blame manual -w switch - "Ignore whitespace when comparing the parent's version and the child's to find where the lines came from.". So I guess this switch can completely resolve this problem.

So think, how much you use git blame and how much it annoys other possible contributors, that tries to hack some thing in such code.

In configuration files, that I copied with --copy-config=all, I already replaced all tabs to spaces and all "from foo import *", since such imports confuse my pyflakes and syntastic error checkers in vim, making them unusable, since there is no way to track undefined name errors at all.

Mantas <sirex>
Mon 26 Mar 2012 08:35:43 PM UTC, comment #1:

I use spaces in new projects for quite a while now and I already thought about replacing tabs with spaces in ranger. But I think one shouldn't change lines in an older project without a necessity. It messes with git (for example, limits the backtracking capabilities of "git blame") and breaks patches.

"from foo import *" is useful too IMO. It's mostly used in configuration files where it includes functions from rangers API. This way, the lazy user won't have to bother updating the import line when a new API feature is added.

I will change the "from foo import *" lines in non-configuration files though.

Roman Z. <hut>
Project Administrator
Mon 26 Mar 2012 07:51:02 PM UTC, original submission:

Great project! But code with tabs looks terrible. Is there any chances, that all TABS in all files could be replaced with 4 spaces?

Here is quote from PEP-8 [1] „For new projects, spaces-only are strongly recommended over tabs. Most editors have features that make this easy to do.“

Also there is some places, with ``from X import *``, it is recommended to never do that.

If you agree to fallow PEP-8, I could take some time, and make all code PEP-8 compatible.

[1] http://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

Mantas <sirex>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #26423:  pep8.patch added by sirex (2KiB - text/x-patch - Changed tabs to spaces.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by hut (Posted a comment)
  • -unavailable- added by sirex (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 10 Feb 2013 02:45:32 AM UTChutStatusPostponed=>Fixed
      Open/ClosedOpen=>Closed
    Fri 24 Aug 2012 07:43:25 PM UTCsirexAttached File-=>Added pep8.patch, #26423
    Tue 27 Mar 2012 03:23:02 PM UTChutStatusNone=>Postponed

    Back to the top


    Powered by Savane 3.1-cleanup1