-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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-size
to 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 = 2
orpyink-indentation = 2
.But we may as well support it for as long as we default to 4 spaces.
Test Plan
Changed integration test