Respect tab-size setting in formatter#8006
Conversation
|
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
ad747f4 to
02c269e
Compare
108ddc7 to
366d2be
Compare
02c269e to
0817df9
Compare
0817df9 to
463165c
Compare
366d2be to
a583805
Compare
a583805 to
f1b00ca
Compare
PR Check ResultsEcosystem✅ ecosystem check detected no changes. |
charliermarsh
left a comment
There was a problem hiding this comment.
Cool, so this both respects the tab width for tab-based indentation and allows changing the number of spaces?
|
Maybe this should look at |
That's correct. It's the one setting that configures the indentation.
We may want to support a |
Do you mean editor-config's indent size? If so, Google's Python style guide has it set to two. So that's practically every Google project. |
Yes, that's what I was considering. We decided to support configuring the number of spaces. |

Summary
This PR changes the formatter to use the global
tab-sizeto configure the number of spaces used for soft-tabs or width of a hard-tab character.Closes #7648
Open Questions
I'm still somewhat undecided whether we should support changing the number of spaces for soft tabs. I only found few projects that set
tab-size = 2orpyink-indentation = 2.But we may as well support it for as long as we default to 4 spaces.
Test Plan
Changed integration test