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

Intermediate fix for indenting huge dicts #91

Merged
merged 4 commits into from
Nov 16, 2017
Merged

Intermediate fix for indenting huge dicts #91

merged 4 commits into from
Nov 16, 2017

Conversation

blueyed
Copy link
Member

@blueyed blueyed commented Oct 5, 2017

This uses different offsets for the type of pairs: '()' and '[]' will
only look for just 20 lines above, while 1000 lines are used for '{}',
which might be a huge dict.

Ref: #64.

@blueyed blueyed mentioned this pull request Oct 5, 2017
2 tasks
@mgedmin
Copy link

mgedmin commented Oct 6, 2017

FWIW I've had some list literals longer than 20 lines. For example: https://github.com/ManoSeimas/manoseimas.lt/blob/master/manoseimas/scrapy/tests/test_suggestions.py#L770-L806

@blueyed
Copy link
Member Author

blueyed commented Oct 6, 2017

@mgedmin
Ok, let's use 100 then for [].

I have some ideas to improve upon this (by doing a quick lookup first and using caching), but this should be good as is for an indermediate fix then.

This uses different offsets for the type of pairs: '()' and '[]' will
only look for just 20 lines above, while 1000 lines are used for '{}',
which might be a huge dict.

Ref: #64.
@mgedmin
Copy link

mgedmin commented Nov 16, 2017

Just had to indent another 80-line list literal. This PR worked fine.

@blueyed blueyed merged commit 797b82c into master Nov 16, 2017
@blueyed blueyed deleted the maxoff-by-type branch November 16, 2017 17:47
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.

2 participants