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

Make CONTINUATION_INDENT_WIDTH configurable. #78

Open
zhou13 opened this issue Jun 20, 2017 · 9 comments
Open

Make CONTINUATION_INDENT_WIDTH configurable. #78

zhou13 opened this issue Jun 20, 2017 · 9 comments

Comments

@zhou13
Copy link

zhou13 commented Jun 20, 2017

Current vim will indent as

tf.app.flags.DEFINE_string(
  'log', 'INFO',
  'The threshold for what messages will be logged DEBUG, INFO, WARN, ERROR, '
  'or FATAL.')

with sw=2. However, I want to have the following indent (google style):

tf.app.flags.DEFINE_string(
    'log', 'INFO',
    'The threshold for what messages will be logged DEBUG, INFO, WARN, ERROR, '
    'or FATAL.')

In yapf, this is configurable by option CONTINUATION_INDENT_WIDTH.

@blueyed
Copy link
Member

blueyed commented Jun 20, 2017

What is yapf?
And why would you use sw=2 with Python files?

@zhou13
Copy link
Author

zhou13 commented Jun 20, 2017

What is yapf?

https://github.com/google/yapf

And why would you use sw=2 with Python files?

That is in google's internal Google Python Style guide. Many open source libraries from google such as tensorflow follow this convention, e.g., https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/bayesflow/python/kernel_tests/monte_carlo_test.py

Also see,
https://www.chromium.org/chromium-os/python-style-guidelines

@blueyed
Copy link
Member

blueyed commented Jun 20, 2017

So they use 2 spaces instead of 4 for indentation, but then 4 for something else?! / hanging indents?!

@blueyed
Copy link
Member

blueyed commented Jun 20, 2017

(havent't checked the specific links (the last 2 ones))

@zhou13
Copy link
Author

zhou13 commented Jun 20, 2017

@blueyed
Copy link
Member

blueyed commented Jun 21, 2017

Ok, feel free to get this integrated somehow here - I am not much interested myself.

Maybe it could be defined as something like 2 * &sw in special cases?!

@zhou13
Copy link
Author

zhou13 commented Jun 21, 2017

I prefer hard code it to 4, as both pep8 and google prefer this value.

@blueyed
Copy link
Member

blueyed commented Jun 21, 2017

Then do it.. :)

(but be warned that the current test suite is rather ugly)

@zhou13
Copy link
Author

zhou13 commented Jun 22, 2017

Please review #79

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants