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

Improve and simplify the CommaProxyList algorithm. #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

duncf
Copy link
Contributor

@duncf duncf commented Jul 22, 2017

With this change CommaProxyList better handles and preserves non-standard (and
even inconsistent) indentation, rather than assuming indented lists are indented
by four spaces (fixes #100). It also is significantly faster in very large files
by avoiding use of ".indentation", which can require iterating over every
element in the file. End-of-list comments are preserved at the end of the list,
and inline comments are also preserved.

With this change CommaProxyList better handles and preserves non-standard (and
even inconsistent) indentation, rather than assuming indented lists are indented
by four spaces (fixes PyCQA#100). It also is significantly faster in very large files
by avoiding use of ".indentation", which can require iterating over every
element in the file. End-of-list comments are preserved at the end of the list,
and inline comments are also preserved.
@janlugt
Copy link

janlugt commented Jan 4, 2018

I have the same issue, could this please be merged?

@janlugt
Copy link

janlugt commented May 16, 2018

@Psycojoker, could you take a look at this?

@janlugt
Copy link

janlugt commented Dec 9, 2019

@Psycojoker, could you reconsider merging this and #145? It dramatically improves the performance of the CommaProxyList algorithm.

@hectorv
Copy link

hectorv commented Apr 30, 2020

+1
The CommaList exception got me here.

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.

handle indented cases in CommaProxyList
3 participants