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

fix: do not guess indent if majority is lines with no indent #12810

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

Conversation

AlexanderBrevig
Copy link
Contributor

@AlexanderBrevig AlexanderBrevig commented Feb 7, 2025

TLDR: Err on the side of caution by returning None if the majority of lines has no indentation

After seeing #12783 and then #9556 I had a think about it, and my conclusion is that it's hard to determine when the file has a majority of lines with no indent.

This effectively skews the heuristic to only guess when a certain indent level and type is in excess of lines with no indents.

While playing around with this I found that it will have a hard time on very short scripts that has a lot of includes, but the fallback to config then tab still was fine for me.

I completely understand if this is not in line with what was planned, so feel free to close with no need to explain.

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.

1 participant